0 points

Testing Asynchronous Code · Jest


dashboard

Fri Sep 04 2020 05:57:34 GMT+0000 (UTC)

Posted by @vrzi #javascript #jest

test('the data is peanut butter', () => {
  expect.assertions(1);
  return fetchData().then(data => {
    expect(data).toBe('peanut butter');
  });
});
content_copy Copy

https://deltice.github.io/jest/docs/pt-BR/asynchronous.html#content