Skip to content

Commit

Permalink
Tweak schedule test
Browse files Browse the repository at this point in the history
  • Loading branch information
afshin committed Sep 12, 2022
1 parent 60c92d8 commit d226865
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/coreutils/tests/src/schedule.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ function sleep(milliseconds: number = 0): Promise<unknown> {

describe('@lumino/coreutils', () => {
describe('schedule() and unschedule()', () => {
it('should schedule a deferred function invocation', done => {
schedule(() => void done());
it('should schedule a deferred function invocation', async () => {
let called = false;
schedule(() => (called = true));
await sleep(200);
expect(called).to.equal(true);
});

it('should allow a callback to be unscheduled', async () => {
Expand Down

0 comments on commit d226865

Please sign in to comment.