0 points

Testing Asynchronous Code · Jest


dashboard

Fri Sep 04 2020 05:41:53 GMT+0000 (UTC)

Posted by @vrzi #javascript #jest

test('the data is peanut butter', done => {
  function callback(data) {
    expect(data).toBe('peanut butter');
    done();
  }

  fetchData(callback);
});
content_copy Copy

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