-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: setup jest for use with Typescript tests (#106)
* chore: add ts-jest and dependencies * chore: expand tsconfig to `test` directory * chore: add jest config and script to run Typescript tests * chore: improve import sort linting autogrouping * tests: convert submission.server.model tests to Typescript * chore: add jest-mongodb present to jest setup This allows for use of mongodb without any setting up or tearing down of mongodb between tests * test: migrate myinfo service test to Typescript * feat: remove usage of spec in db-handler * build: add specific tsconfig for building that ignores tests * chore: add jest-mongodb-config and migrate SmsCountModel tests With this, we can eventually stop using `npm run download-binary` and delete `tests/end-to-end/helpers/get-mongo-binary.js` since the config automatically retrieves that information for us. * chore: add documentation to gitignore * fix: check mongoose MD5 binary when starting jest tests * refactor: convert form_fields schema tests to Typescript
- Loading branch information
Showing
40 changed files
with
4,319 additions
and
2,460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
mongodbMemoryServerOptions: { | ||
binary: { | ||
version: process.env.MONGO_BINARY_VERSION || '3.6.12', | ||
checkMD5: true, | ||
}, | ||
instance: { | ||
dbName: 'jest', | ||
}, | ||
autoStart: false, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { defaults: tsJestPreset } = require('ts-jest/presets') | ||
|
||
module.exports = { | ||
preset: '@shelf/jest-mongodb', | ||
testEnvironment: 'node', | ||
testMatch: ['**/?(*.)+(spec|test).[t]s?(x)'], | ||
modulePaths: ['<rootDir>'], | ||
transform: { | ||
// Needed to use @shelf/jest-mongodb preset. | ||
...tsJestPreset.transform, | ||
}, | ||
} |
Oops, something went wrong.