Update mongodb to the latest version 🚀 (#5914)

* fix(package): update mongodb to version 3.3.0

* chore(package): update lockfile package-lock.json

* Fix tests

* Fix GraphQL tests for read preference

* Fix mongo adapter deprecation notice

* Fix the way the connections are checked, return promise when shutting down mongo
This commit is contained in:
greenkeeper[bot]
2019-08-14 01:25:49 +00:00
committed by peril-parse-community[bot]
parent 6760ceb836
commit 4c1be61bed
7 changed files with 170 additions and 167 deletions

View File

@@ -280,10 +280,17 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
};
adapter.createObject('MyClass', schema, {}).then(() => {
expect(adapter.database.serverConfig.isConnected()).toEqual(true);
adapter.handleShutdown();
expect(adapter.database.serverConfig.isConnected()).toEqual(false);
done();
expect(adapter.database.serverConfig.connections().length > 0).toEqual(
true
);
expect(adapter.database.serverConfig.s.connected).toEqual(true);
adapter.handleShutdown().then(() => {
expect(adapter.database.serverConfig.connections().length > 0).toEqual(
false
);
expect(adapter.database.serverConfig.s.connected).toEqual(false);
done();
});
});
});