From 794d3007461ae23399a9bc962f90684f84902c0d Mon Sep 17 00:00:00 2001 From: richardtekula Date: Wed, 17 Dec 2025 10:54:59 +0100 Subject: [PATCH] add test to gitignore & jest settings --- .gitignore | 1 + jest.config.js | 12 ++++++++++++ package.json | 6 +----- 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 jest.config.js diff --git a/.gitignore b/.gitignore index 32dc5f9..42c6960 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ Thumbs.db # Testing coverage/ .nyc_output/ +__tests__/ # Build dist/ diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..a07c535 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,12 @@ +export default { + testEnvironment: 'node', + transform: {}, + testMatch: ['**/__tests__/routes/**/*.test.js'], + moduleFileExtensions: ['js', 'mjs'], + verbose: true, + testTimeout: 30000, + // ESM modules need isolation - each test file gets its own module cache + maxWorkers: 1, + forceExit: true, + detectOpenHandles: false, +}; diff --git a/package.json b/package.json index 04296ff..6454edb 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,5 @@ "nodemon": "^3.1.7", "supertest": "^6.3.4" }, - "type": "module", - "jest": { - "testEnvironment": "node", - "transform": {} - } + "type": "module" }