Skip to content

Commit

Permalink
fix(backend): update jest module aliases and commands
Browse files Browse the repository at this point in the history
Removed npm test:watch as we can just use npm t -- --watch instead.
Did this to avoid duplicating pretest step.
  • Loading branch information
lamkeewei committed May 5, 2021
1 parent 32d343f commit b52fc6c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
'@email/(.*)': '<rootDir>/src/email/$1',
'@telegram/(.*)': '<rootDir>/src/telegram/$1',
'@test-utils/(.*)': '<rootDir>/src/test-utils/$1',
'@shared/(.*)': '<rootDir>/../shared/src/$1',
},
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
Expand Down
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"description": "Backend / API server for Postman",
"main": "build/server.js",
"scripts": {
"build": "rimraf build && tsc --build -p tsconfig.build.json",
"build": "rimraf build && tsc --build tsconfig.build.json",
"dev": "npm run postbuild && tsc-watch --onSuccess \"node ./build/server.js\"",
"lint-no-fix": "tsc --noEmit && eslint --ext .js,.ts --cache .",
"lint": "npm run lint-no-fix -- --fix",
"postbuild": "npm run copy-assets",
"start": "node build/server",
"copy-assets": "copyfiles -u 1 src/assets/* src/**/*.sql build",
"pretest": "tsc --build",
"test": "jest --maxWorkers=2",
"test:watch": "jest --watch",
"precommit": "lint-staged"
},
"author": "",
Expand Down
7 changes: 6 additions & 1 deletion backend/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// Excludes test in builds
// We have to duplicate project references as they are not inherited.
// See: https://github.com/microsoft/TypeScript/issues/27098
{
"extends": "./tsconfig.json",
"exclude": ["tests/"]
"exclude": ["tests/"],
"references": [
{ "path": "../shared" }
]
}
2 changes: 1 addition & 1 deletion backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@email/*": ["email/*"],
"@telegram/*": ["telegram/*"],
"@shared/*": ["../../shared/src/*"],
"@test-utils/*": ["src/test-utils/*"]
"@test-utils/*": ["test-utils/*"]
},
"esModuleInterop": true,
"experimentalDecorators": true,
Expand Down

0 comments on commit b52fc6c

Please sign in to comment.