Skip to content

Commit

Permalink
Fixed Backend Tests wiith Babel
Browse files Browse the repository at this point in the history
  • Loading branch information
R1c4rdCo5t4 committed Mar 25, 2024
1 parent 7272796 commit 9b15b31
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions code/server/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
]
}
6 changes: 3 additions & 3 deletions code/server/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { pathsToModuleNameMapper } = require('ts-jest');

module.exports = {
preset: 'ts-jest',
testEnvironment: 'jest-environment-node',
testEnvironment: 'node',
transform: {},
moduleNameMapper: pathsToModuleNameMapper({ '@src/*': ['./src/*'] }, { prefix: '<rootDir>/' }),
transform: {}
};
};
5 changes: 4 additions & 1 deletion code/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"serve": "tsc && node dist/server.js",
"start": "tsx watch -r tsconfig-paths/register src/server.ts",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"test": "jest --detectOpenHandles --config jest.config.js",
"knip": "knip",
"format": "prettier --write . && eslint . --ext .ts"
},
Expand All @@ -23,6 +23,8 @@
"supertest": "^6.3.4"
},
"devDependencies": {
"@babel/preset-env": "^7.24.3",
"@babel/preset-typescript": "^7.24.1",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
Expand All @@ -31,6 +33,7 @@
"@types/supertest": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"babel-jest": "^29.7.0",
"eslint": "^8.57.0",
"jest": "^29.7.0",
"knip": "^5.2.2",
Expand Down

0 comments on commit 9b15b31

Please sign in to comment.