Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
coratgerl committed Sep 23, 2023
1 parent e59d724 commit e19c78e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"lint-fix": "eslint --fix --cache ./",
"build": "babel src/ -d lib/ --copy-files",
"watch": "babel --watch src/ -d lib/ --copy-files",
"test:mongodb:runnerstart": "cross-env mongodb-runner start -t standalone --version $npm_config_dbversion -- --port 27017",
"test:mongodb:runnerstart": "cross-env mongodb-runner stop --all && mongodb-runner start -t standalone --version $npm_config_dbversion -- --port 27017",
"test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine",
"test:mongodb": "npm run test:mongodb:runnerstart --dbversion=$npm_config_dbversion && npm run test:mongodb:testonly --dbversion=$npm_config_dbversion",
"test:mongodb:4.2.19": "npm run test:mongodb --dbversion=4.2.19",
Expand Down
3 changes: 3 additions & 0 deletions src/Adapters/Storage/Mongo/MongoStorageAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const storageAdapterAllCollections = mongoAdapter => {
.connect()
.then(() => mongoAdapter.database.collections())
.then(collections => {
if (!collections || !collections.length) return [];

return collections.filter(collection => {
if (collection.namespace.match(/\.system\./)) {
return false;
Expand Down Expand Up @@ -399,6 +401,7 @@ export class MongoStorageAdapter implements StorageAdapter {
}

deleteAllClasses(fast: boolean) {
// @flow-disable-next
return storageAdapterAllCollections(this).then(collections =>
Promise.all(
collections.map(collection => (fast ? collection.deleteMany({}) : collection.drop()))
Expand Down

0 comments on commit e19c78e

Please sign in to comment.