test: improve app 'session-created' event spec (#25799)
This commit is contained in:
parent
a5ca25ba65
commit
65089a69a1
1 changed files with 4 additions and 4 deletions
|
@ -979,10 +979,10 @@ describe('session module', () => {
|
||||||
|
|
||||||
describe('session-created event', () => {
|
describe('session-created event', () => {
|
||||||
it('is emitted when a session is created', async () => {
|
it('is emitted when a session is created', async () => {
|
||||||
const eventEmitted = new Promise<Session>(resolve => app.once('session-created', resolve));
|
const sessionCreated = emittedOnce(app, 'session-created');
|
||||||
session.fromPartition('' + Math.random());
|
const session1 = session.fromPartition('' + Math.random());
|
||||||
const s = await eventEmitted;
|
const [session2] = await sessionCreated;
|
||||||
expect(s.constructor.name).to.equal('Session');
|
expect(session1).to.equal(session2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue