Skip to content

Testing with setTimeout #9

@helenzhou6

Description

@helenzhou6

Not sure if you managed to get round to it, but you can pass in done() as a callback in jest:

it('mock setTimeout test', (done) => {
  setTimeout(() => {
    console.log('TIME IS UP');
    done();
  }, 1000);
});

(Thanks for this post)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions