fix(core): update
This commit is contained in:
10
test/test.ts
10
test/test.ts
@ -9,12 +9,12 @@ tap.test('should create an emitter ->', async () => {
|
||||
expect(myEventEmitter).to.be.instanceof(smartevent.EventEmitter);
|
||||
});
|
||||
|
||||
tap.test('smartevent.once -> should return a promise', async () => {
|
||||
let oncePromise = smartevent.once(myEventEmitter, 'customEvent');
|
||||
tap.test('smartevent.once -> should return a promise', async (tools) => {
|
||||
const oncePromise = smartevent.once(myEventEmitter, 'customEvent');
|
||||
expect(oncePromise).to.be.instanceof(Promise);
|
||||
expect(oncePromise).to.not.be.fulfilled;
|
||||
myEventEmitter.emit('customEvent');
|
||||
await expect(oncePromise).to.eventually.be.fulfilled;
|
||||
expect(oncePromise).to.not.be.rejected;
|
||||
myEventEmitter.emit('customEvent', 'hithere');
|
||||
await expect(oncePromise).to.eventually.be.fulfilled.with.equal('hithere');
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
Reference in New Issue
Block a user