This commit is contained in:
MartinBraquet
2025-11-15 01:04:41 +01:00
parent 36c1ec528a
commit 09d743c603
10 changed files with 65 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ module.exports = {
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.json'
tsconfig: "<rootDir>/tsconfig.test.json"
}
},

View File

@@ -21,7 +21,8 @@
"verify:dir": "npx eslint . --max-warnings 0",
"regen-types": "cd ../supabase && make ENV=prod regen-types",
"regen-types-dev": "cd ../supabase && make ENV=dev regen-types-dev",
"test": "jest --config jest.config.js"
"test": "jest --config jest.config.js",
"test:coverage": "jest --config jest.config.js --coverage"
},
"engines": {
"node": ">=20.0.0"

View File

@@ -1,7 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": ".",
// Use / as the root for tests so path-mapped imports from
// ../shared and ../../common are within the configured rootDir.
// This avoids TS6059 during ts-jest compilation.
"rootDir": "../..",
"baseUrl": ".",
"paths": {
"api/*": ["src/*"],

View File

@@ -20,7 +20,7 @@ module.exports = {
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.json'
tsconfig: "<rootDir>/tsconfig.test.json"
}
},

View File

@@ -0,0 +1,17 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
// Use / as the root for tests so path-mapped imports from
// ../shared and ../../common are within the configured rootDir.
// This avoids TS6059 during ts-jest compilation.
"rootDir": "../..",
"baseUrl": ".",
"paths": {
"api/*": ["src/*"],
"shared/*": ["../shared/src/*"],
"common/*": ["../../common/src/*"],
"email/*": ["../email/emails/*"]
}
},
"include": ["tests/**/*.ts", "src/**/*.ts"]
}

View File

@@ -20,7 +20,7 @@ module.exports = {
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.json'
tsconfig: "<rootDir>/tsconfig.test.json"
}
},

View File

@@ -0,0 +1,17 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
// Use / as the root for tests so path-mapped imports from
// ../shared and ../../common are within the configured rootDir.
// This avoids TS6059 during ts-jest compilation.
"rootDir": "../..",
"baseUrl": ".",
"paths": {
"api/*": ["src/*"],
"shared/*": ["../shared/src/*"],
"common/*": ["../../common/src/*"],
"email/*": ["../email/emails/*"]
}
},
"include": ["tests/**/*.ts", "src/**/*.ts"]
}

View File

@@ -13,4 +13,11 @@ module.exports = {
// 'backend/api/src',
// 'martin',
],
projects: [
"<rootDir>/backend/api",
"<rootDir>/backend/shared",
"<rootDir>/backend/email",
"<rootDir>/common",
"<rootDir>/web"
],
};

View File

@@ -20,7 +20,7 @@ module.exports = {
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.json'
tsconfig: "<rootDir>/tsconfig.test.json"
}
},

14
web/tsconfig.test.json Normal file
View File

@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
// Use / as the root for tests so path-mapped imports from
// ../shared and ../../common are within the configured rootDir.
// This avoids TS6059 during ts-jest compilation.
"rootDir": "..",
"baseUrl": ".",
"paths": {
"common/*": ["../../common/src/*"],
}
},
"include": ["tests/**/*.ts", "src/**/*.ts"]
}