refactor(server): use ava (#4120)

This commit is contained in:
Alex Yang
2023-09-01 14:41:29 -05:00
committed by GitHub
parent 8845bb9b4b
commit eb1a21265f
19 changed files with 1313 additions and 952 deletions

View File

@@ -11,11 +11,8 @@
"build": "tsc",
"start": "node --loader ts-node/esm.mjs --es-module-specifier-resolution node ./src/index.ts",
"dev": "nodemon ./src/index.ts",
"test": "yarn exec ts-node-esm ./scripts/run-test.ts all",
"test:select": "yarn exec ts-node-esm ./scripts/run-test.ts",
"test:watch": "yarn exec ts-node-esm ./scripts/run-test.ts all --watch",
"test:select:watch": "yarn exec ts-node-esm ./scripts/run-test.ts --watch",
"test:coverage": "c8 yarn exec ts-node-esm ./scripts/run-test.ts all",
"test": "ava --concurrency 1 --serial",
"test:coverage": "c8 ava --concurrency 1 --serial",
"postinstall": "prisma generate"
},
"dependencies": {
@@ -90,6 +87,7 @@
"@types/sinon": "^10.0.16",
"@types/supertest": "^2.0.12",
"@types/ws": "^8.5.5",
"ava": "^5.3.1",
"c8": "^8.0.1",
"nodemon": "^3.0.1",
"sinon": "^15.2.0",
@@ -97,6 +95,27 @@
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
},
"ava": {
"extensions": {
"ts": "module"
},
"nodeArguments": [
"--loader",
"ts-node/esm.mjs",
"--es-module-specifier-resolution",
"node"
],
"files": [
"src/**/*.spec.ts"
],
"require": [
"./src/prelude.ts"
],
"environmentVariables": {
"TS_NODE_PROJECT": "./tsconfig.json",
"NODE_ENV": "test"
}
},
"nodemonConfig": {
"exec": "node",
"script": "./src/index.ts",