diff --git a/code/server/.babelrc b/code/server/.babelrc new file mode 100644 index 00000000..c58af5b1 --- /dev/null +++ b/code/server/.babelrc @@ -0,0 +1,6 @@ +{ + "presets": [ + "@babel/preset-env", + "@babel/preset-typescript" + ] +} \ No newline at end of file diff --git a/code/server/jest.config.js b/code/server/jest.config.js index f7017093..b186f5f2 100644 --- a/code/server/jest.config.js +++ b/code/server/jest.config.js @@ -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: '/' }), - transform: {} -}; +}; \ No newline at end of file diff --git a/code/server/package.json b/code/server/package.json index 52b88a14..892595e7 100644 --- a/code/server/package.json +++ b/code/server/package.json @@ -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" }, @@ -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", @@ -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",