test: improve app 'session-created' event spec (#25804)

Co-authored-by: Milan Burda <milan.burda@gmail.com>
This commit is contained in:
trop[bot]
2020-10-08 20:39:27 -07:00
committed by GitHub
parent 56a764d510
commit 624ea4b694

View File

@@ -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);
});
});
});