Skip to content

Commit

Permalink
test: improve app 'session-created' event spec (#25804)
Browse files Browse the repository at this point in the history
Co-authored-by: Milan Burda <milan.burda@gmail.com>
  • Loading branch information
trop[bot] and miniak committed Oct 9, 2020
1 parent 56a764d commit 624ea4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec-main/api-session-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});

0 comments on commit 624ea4b

Please sign in to comment.