Skip to content

Commit e3b42cd

Browse files
committed
Trying another way to run mongodb-runner
1 parent ac3b22c commit e3b42cd

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@
9595
"lint": "flow && eslint --cache ./",
9696
"build": "babel src/ -d lib/ --copy-files",
9797
"watch": "babel --watch src/ -d lib/ --copy-files",
98+
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.0.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=mmapv1} mongodb-runner start",
9899
"test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.0.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=mmapv1} TESTING=1 jasmine",
100+
"posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.0.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=mmapv1} mongodb-runner stop",
99101
"coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=4.0.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} MONGODB_STORAGE_ENGINE=${MONGODB_STORAGE_ENGINE:=mmapv1} TESTING=1 nyc jasmine",
100102
"start": "node ./bin/parse-server",
101103
"prepare": "npm run build",

spec/helper.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,12 @@ const postgresURI =
4040
let databaseAdapter;
4141
// need to bind for mocking mocha
4242

43-
let startDB = () => {};
44-
let stopDB = () => {};
45-
4643
if (process.env.PARSE_SERVER_TEST_DB === 'postgres') {
4744
databaseAdapter = new PostgresStorageAdapter({
4845
uri: process.env.PARSE_SERVER_TEST_DATABASE_URI || postgresURI,
4946
collectionPrefix: 'test_',
5047
});
5148
} else {
52-
startDB = require('mongodb-runner/mocha/before').bind({
53-
timeout: () => {},
54-
slow: () => {},
55-
});
56-
stopDB = require('mongodb-runner/mocha/after');
5749
databaseAdapter = new MongoStorageAdapter({
5850
uri: mongoURI,
5951
collectionPrefix: 'test_',
@@ -177,11 +169,6 @@ const reconfigureServer = changedConfiguration => {
177169
const Parse = require('parse/node');
178170
Parse.serverURL = 'http://localhost:' + port + '/1';
179171

180-
// 10 minutes timeout
181-
beforeAll(startDB, 10 * 60 * 1000);
182-
183-
afterAll(stopDB);
184-
185172
beforeEach(done => {
186173
try {
187174
Parse.User.enableUnsafeCurrentUser();

0 commit comments

Comments
 (0)