Skip to content

Commit

Permalink
test: improve app 'session-created' event spec
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak authored and Milan Burda committed Oct 8, 2020
1 parent 7ae4b2b commit 384e53c
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 384e53c

Please sign in to comment.