1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/test/frontend/lib/deferred.test.ts

15 lines
400 B
TypeScript
Raw Normal View History

2023-02-14 11:04:40 +01:00
import Deferred from 'lib/deferred';
describe('Deferred', () => {
test('resolve a deferred promise', () => {
const deferred = new Deferred();
deferred.resolve(4);
expect(deferred.promise).resolves.toBe(4);
});
test('reject a deferred promise', () => {
const deferred = new Deferred();
deferred.reject('error');
expect(deferred.promise).rejects.toBe('error');
});
});