Skip to content

Commit

Permalink
WIP [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
CMCDragonkai committed Aug 22, 2022
1 parent b2afd44 commit f629f67
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 176 deletions.
161 changes: 0 additions & 161 deletions test-abortable.ts

This file was deleted.

15 changes: 0 additions & 15 deletions tests/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,4 @@ describe('utils', () => {
}
}
});
test('cancel promise', async () => {
let timeout: ReturnType<typeof setTimeout> | undefined;
const pC = new PromiseCancellable<void>((resolve, reject, signal) => {
timeout = setTimeout(() => resolve(), 5000);
signal.onabort = () => {
clearTimeout(timeout);
timeout = undefined;
reject(signal.reason);
};
});
expect(timeout).toBeDefined();
pC.cancel('cancellation');
await expect(pC).rejects.toBe('cancellation');
expect(timeout).toBeUndefined();
});
});

0 comments on commit f629f67

Please sign in to comment.