Skip to content

Commit ef55e27

Browse files
committed
test: add 2 workers more for jest and fix problem with test #78
1 parent 806fb1f commit ef55e27

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"build-flow": "echo `$1` && find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`.flow; done",
9494
"build-ts": "find ./src -name '*.d.ts' -not -path '*/__*' | while read filepath; do cp $filepath `echo ./${COPY_TO_FOLDER:-lib}$filepath | sed 's/.\\/src\\//\\//g'`; done",
9595
"watch": "jest --watch",
96-
"coverage": "jest --coverage --maxWorkers 2",
96+
"coverage": "jest --coverage --maxWorkers 4",
9797
"lint": "npm run eslint && npm run tslint",
9898
"eslint": "eslint --ext .js ./src",
9999
"tslint": "tslint -p . \"src/**/*.d.ts\"",

src/__tests__/guthub_issues/78-test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
/* @flow */
22

33
import mongoose from 'mongoose';
4+
import MongodbMemoryServer from 'mongodb-memory-server';
45
import { schemaComposer, graphql } from 'graphql-compose';
56
import { composeWithMongoose } from '../../index';
67

8+
let mongoServer;
9+
beforeAll(async () => {
10+
mongoServer = new MongodbMemoryServer();
11+
const mongoUri = await mongoServer.getConnectionString();
12+
await mongoose.connect(
13+
mongoUri,
14+
{ useNewUrlParser: true }
15+
);
16+
});
17+
18+
afterAll(() => {
19+
mongoose.disconnect();
20+
mongoServer.stop();
21+
});
22+
723
// May require additional time for downloading MongoDB binaries
824
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
925

0 commit comments

Comments
 (0)