Skip to content

Commit

Permalink
test(sessions): fixing broken session test
Browse files Browse the repository at this point in the history
  • Loading branch information
daprahamian authored and mbroadst committed Jan 14, 2019
1 parent 6790a74 commit 0eaca21
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions test/functional/sessions_tests.js
Expand Up @@ -50,19 +50,17 @@ describe('Sessions', function() {
sessions: { skipLeakTests: true }
},
test: function(done) {
var client = this.configuration.newClient({ w: 1 }, { poolSize: 1, auto_reconnect: false });
client.connect((err, client) => {
let sessions = [client.startSession(), client.startSession()].map(s => s.id);
const client = test.client;
let sessions = [client.startSession(), client.startSession()].map(s => s.id);

client.close(err => {
expect(err).to.not.exist;
expect(test.commands.started).to.have.length(1);
expect(test.commands.started[0].commandName).to.equal('endSessions');
expect(test.commands.started[0].command.endSessions).to.include.deep.members(sessions);
client.close(err => {
expect(err).to.not.exist;
expect(test.commands.started).to.have.length(1);
expect(test.commands.started[0].commandName).to.equal('endSessions');
expect(test.commands.started[0].command.endSessions).to.include.deep.members(sessions);

expect(client.s.sessions).to.have.length(0);
done();
});
expect(client.s.sessions).to.have.length(0);
done();
});
}
});
Expand Down

0 comments on commit 0eaca21

Please sign in to comment.