Skip to content

Commit 32be8a5

Browse files
make all tests fail
1 parent f8020a7 commit 32be8a5

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

test/unit/api.test.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ const { classNameToMethodList } = require('../tools/api');
1010
const { byStrings, sorted, runMicroTask } = require('../tools/utils');
1111

1212
// Dummy data to help with testing
13-
const iLoveJs = 'mongodb://iLoveJavascript';
14-
const client = new mongodbLegacy.MongoClient(iLoveJs);
15-
const db = new mongodbLegacy.Db(client, 'animals');
16-
const collection = new mongodbLegacy.Collection(db, 'pets');
17-
const namespace = MongoDBNamespace.fromString('animals.pets');
13+
let iLoveJs = 'mongodb://iLoveJavascript';
14+
let client = new mongodbLegacy.MongoClient(iLoveJs);
15+
let db = new mongodbLegacy.Db(client, 'animals');
16+
let collection = new mongodbLegacy.Collection(db, 'pets', {});
17+
let namespace = MongoDBNamespace.fromString('animals.pets');
18+
19+
function initialize() {
20+
iLoveJs = 'mongodb://iLoveJavascript';
21+
client = new mongodbLegacy.MongoClient(iLoveJs);
22+
db = new mongodbLegacy.Db(client, 'animals');
23+
collection = new mongodbLegacy.Collection(db, 'pets', {});
24+
namespace = MongoDBNamespace.fromString('animals.pets');
25+
}
1826

1927
// A map to helpers that can create instances of the overridden classes for testing
2028
const OVERRIDDEN_CLASSES_GETTER = new Map([
@@ -126,6 +134,9 @@ describe('wrapper API', () => {
126134
possibleCallbackPositions,
127135
makeStub
128136
} of generateTests()) {
137+
138+
initialize();
139+
129140
expect(instance, apiName).to.have.property(method).that.is.a('function');
130141
const functionLength = instance[method].length;
131142

0 commit comments

Comments
 (0)