Skip to content

Commit

Permalink
test(sessions): undo hack for apm events in sessions tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daprahamian authored and mbroadst committed Jan 14, 2019
1 parent 0eaca21 commit d4eae97
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions test/functional/sessions_tests.js
Expand Up @@ -9,19 +9,6 @@ describe('Sessions', function() {
return setupDatabase(this.configuration);
});

function parseAPMEvent(e) {
// Some silly stuff for OP_QUERY
if (e.commandName === 'find' && e.command && e.command.find === '$cmd') {
const realCommand = e.command.filter;
return Object.assign({}, e, {
command: realCommand,
commandName: Object.keys(realCommand)[0]
});
}

return e;
}

beforeEach(function() {
test.commands = { started: [], succeeded: [] };

Expand All @@ -31,13 +18,13 @@ describe('Sessions', function() {
);
test.client.on('commandStarted', event => {
if (ignoredCommands.indexOf(event.commandName) === -1) {
test.commands.started.push(parseAPMEvent(event));
test.commands.started.push(event);
}
});

test.client.on('commandSucceeded', event => {
if (ignoredCommands.indexOf(event.commandName) === -1) {
test.commands.succeeded.push(parseAPMEvent(event));
test.commands.succeeded.push(event);
}
});
return test.client.connect();
Expand Down

0 comments on commit d4eae97

Please sign in to comment.