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', () => {
|
||||
it('is emitted when a session is created', async () => {
|
||||
const eventEmitted = new Promise<Session>(resolve => app.once('session-created', resolve));
|
||||
session.fromPartition('' + Math.random());
|
||||
const s = await eventEmitted;
|
||||
expect(s.constructor.name).to.equal('Session');
|
||||
const sessionCreated = emittedOnce(app, 'session-created');
|
||||
const session1 = session.fromPartition('' + Math.random());
|
||||
const [session2] = await sessionCreated;
|
||||
expect(session1).to.equal(session2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue