Skip to content

Commit 226c803

Browse files
committed
test(apm): make sure to uninstrument listener after each test
NODE-1132
1 parent 2c88926 commit 226c803

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/functional/apm_tests.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1011,9 +1011,9 @@ describe('APM', function() {
10111011
expect(databaseName).to.equal(result.databaseName);
10121012

10131013
// Do we have a getMore command or killCursor command
1014-
if (commandName == 'getMore') {
1014+
if (commandName === 'getMore') {
10151015
expect(result.command.getMore.isZero()).to.be.false;
1016-
} else if (commandName == 'killCursors') {
1016+
} else if (commandName === 'killCursors') {
10171017
// eslint-disable-line
10181018
} else {
10191019
expect(command).to.eql(result.command);
@@ -1031,7 +1031,7 @@ describe('APM', function() {
10311031
// Validate the test
10321032
expect(commandName).to.equal(result.commandName);
10331033
// Do we have a getMore command
1034-
if (commandName.toLowerCase() == 'getmore' || commandName.toLowerCase() == 'find') {
1034+
if (commandName.toLowerCase() === 'getmore' || commandName.toLowerCase() === 'find') {
10351035
reply.cursor.id = result.reply.cursor.id;
10361036
expect(reply).to.eql(result.reply);
10371037
}
@@ -1136,15 +1136,15 @@ describe('APM', function() {
11361136
}
11371137
}
11381138

1139-
if (typeof args.ordered == 'boolean') {
1139+
if (typeof args.ordered === 'boolean') {
11401140
if (options == null) {
11411141
options = { ordered: args.ordered };
11421142
} else {
11431143
options.ordered = args.ordered;
11441144
}
11451145
}
11461146

1147-
if (typeof args.upsert == 'boolean') {
1147+
if (typeof args.upsert === 'boolean') {
11481148
if (options == null) {
11491149
options = { upsert: args.upsert };
11501150
} else {
@@ -1153,7 +1153,7 @@ describe('APM', function() {
11531153
}
11541154

11551155
// Find command is special needs to executed using toArray
1156-
if (operation.name == 'find') {
1156+
if (operation.name === 'find') {
11571157
var cursor = collection[commandName]();
11581158

11591159
// Set the options
@@ -1245,6 +1245,7 @@ describe('APM', function() {
12451245
executeOperation(client, listener, scenario, test, err => {
12461246
expect(err).to.not.exist;
12471247

1248+
listener.uninstrument();
12481249
client.close();
12491250
done();
12501251
});

0 commit comments

Comments
 (0)