Skip to content

Commit c1cf4cc

Browse files
committed
chore: migrate tests to jest
1 parent 562b46c commit c1cf4cc

19 files changed

+18171
-8288
lines changed

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
testMatch: ['**/*.test.ts']
5+
}

package-lock.json

Lines changed: 15427 additions & 7242 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
"start": "NODE_ENV=production node bin/src/server/app.js",
2424
"dev": "run-s clean && NODE_ENV=development ts-node-dev src/server/app.ts | pino-pretty --colorize",
2525
"pkg": "run-s clean build:server && pkg --out-path bin .pkg.config.json",
26-
"test": "run-s test:db build:server test:run",
26+
"test": "run-s clean test:db build:server test:run; run-s test:clean",
2727
"test:clean": "cd test/db && docker-compose down",
28-
"test:db": "cd test/db && docker-compose down && docker-compose up --detach",
29-
"test:run": "export PG_META_PORT=54321 && (run-s start & wait-for-localhost --use-get $PG_META_PORT && node -r esm ./node_modules/.bin/mocha 'test/**/*.js' --recursive)"
28+
"test:db": "cd test/db && docker-compose up --detach",
29+
"test:run": "export PG_META_PORT=54321 && (run-s start & wait-for-localhost --use-get $PG_META_PORT && jest --runInBand)"
3030
},
3131
"engines": {
3232
"node": ">=14 <15",
@@ -39,22 +39,22 @@
3939
},
4040
"devDependencies": {
4141
"@types/crypto-js": "^3.1.47",
42+
"@types/jest": "^27.0.1",
4243
"@types/node": "^14.0.13",
4344
"@types/pg": "^7.14.3",
4445
"@types/pg-format": "^1.0.1",
45-
"axios": "^0.21.1",
4646
"cpy-cli": "^3.1.1",
4747
"crypto-js": "^4.0.0",
48-
"esm": "^3.2.25",
4948
"fastify": "^3.14.0",
5049
"fastify-cors": "^5.2.0",
5150
"fastify-swagger": "^4.7.0",
52-
"mocha": "^7.1.2",
51+
"jest": "^27.1.0",
5352
"npm-run-all": "^4.1.5",
5453
"pino-pretty": "^4.7.1",
5554
"pkg": "^4.4.8",
5655
"prettier": "^2.0.5",
5756
"rimraf": "^3.0.2",
57+
"ts-jest": "^27.0.5",
5858
"ts-node-dev": "^1.1.6",
5959
"typescript": "^4.3.2",
6060
"wait-for-localhost-cli": "^3.0.0"

0 commit comments

Comments
 (0)