Skip to content

Commit 4c35dd8

Browse files
committed
chore: add jest configs for mongodb
1 parent 28e1ea3 commit 4c35dd8

7 files changed

+1633
-71
lines changed

globalConfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"mongoUri":"mongodb://127.0.0.1:53482/"}

jest-integration-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
const config = require('./jest.config')
2-
config.testMatch = ['**/**.test.ts']
2+
config.testMatch = ['**/*.test.ts']
33
module.exports = config

jest-mongodb-config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
mongodbMemoryServerOptions: {
3+
binary: {
4+
version: '4.0.3',
5+
skipMD5: true
6+
},
7+
autoStart: false,
8+
instance: {}
9+
}
10+
}

jest-unit-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
const config = require('./jest.config')
2-
config.testMatch = ['**/**.spec.ts']
2+
config.testMatch = ['**/*.spec.ts']
33
module.exports = config

jest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module.exports = {
33
roots: ['<rootDir>/src'],
44
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
55
coverageDirectory: 'coverage',
6-
preset: 'ts-jest',
76
testEnvironment: 'node',
7+
preset: '@shelf/jest-mongodb',
88
transform: {
9-
'.+\\.ts&': 'ts-jest' // convert all ts files to js before testing
9+
'.+\\.ts$': 'ts-jest'
1010
}
1111
// testTimeout: 30000
1212
}

0 commit comments

Comments
 (0)