mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
15 lines
400 B
TypeScript
15 lines
400 B
TypeScript
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');
|
|
});
|
|
});
|