Skip to content

Commit 09d743c

Browse files
committed
Fix
1 parent 36c1ec5 commit 09d743c

File tree

10 files changed

+65
-6
lines changed

10 files changed

+65
-6
lines changed

backend/api/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020

2121
globals: {
2222
'ts-jest': {
23-
tsconfig: '<rootDir>/tsconfig.json'
23+
tsconfig: "<rootDir>/tsconfig.test.json"
2424
}
2525
},
2626

backend/api/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"verify:dir": "npx eslint . --max-warnings 0",
2222
"regen-types": "cd ../supabase && make ENV=prod regen-types",
2323
"regen-types-dev": "cd ../supabase && make ENV=dev regen-types-dev",
24-
"test": "jest --config jest.config.js"
24+
"test": "jest --config jest.config.js",
25+
"test:coverage": "jest --config jest.config.js --coverage"
2526
},
2627
"engines": {
2728
"node": ">=20.0.0"

backend/api/tsconfig.test.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"rootDir": ".",
4+
// Use / as the root for tests so path-mapped imports from
5+
// ../shared and ../../common are within the configured rootDir.
6+
// This avoids TS6059 during ts-jest compilation.
7+
"rootDir": "../..",
58
"baseUrl": ".",
69
"paths": {
710
"api/*": ["src/*"],

backend/email/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020

2121
globals: {
2222
'ts-jest': {
23-
tsconfig: '<rootDir>/tsconfig.json'
23+
tsconfig: "<rootDir>/tsconfig.test.json"
2424
}
2525
},
2626

backend/email/tsconfig.test.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
// Use / as the root for tests so path-mapped imports from
5+
// ../shared and ../../common are within the configured rootDir.
6+
// This avoids TS6059 during ts-jest compilation.
7+
"rootDir": "../..",
8+
"baseUrl": ".",
9+
"paths": {
10+
"api/*": ["src/*"],
11+
"shared/*": ["../shared/src/*"],
12+
"common/*": ["../../common/src/*"],
13+
"email/*": ["../email/emails/*"]
14+
}
15+
},
16+
"include": ["tests/**/*.ts", "src/**/*.ts"]
17+
}

backend/shared/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020

2121
globals: {
2222
'ts-jest': {
23-
tsconfig: '<rootDir>/tsconfig.json'
23+
tsconfig: "<rootDir>/tsconfig.test.json"
2424
}
2525
},
2626

backend/shared/tsconfig.test.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
// Use / as the root for tests so path-mapped imports from
5+
// ../shared and ../../common are within the configured rootDir.
6+
// This avoids TS6059 during ts-jest compilation.
7+
"rootDir": "../..",
8+
"baseUrl": ".",
9+
"paths": {
10+
"api/*": ["src/*"],
11+
"shared/*": ["../shared/src/*"],
12+
"common/*": ["../../common/src/*"],
13+
"email/*": ["../email/emails/*"]
14+
}
15+
},
16+
"include": ["tests/**/*.ts", "src/**/*.ts"]
17+
}

jest.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,11 @@ module.exports = {
1313
// 'backend/api/src',
1414
// 'martin',
1515
],
16+
projects: [
17+
"<rootDir>/backend/api",
18+
"<rootDir>/backend/shared",
19+
"<rootDir>/backend/email",
20+
"<rootDir>/common",
21+
"<rootDir>/web"
22+
],
1623
};

web/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020

2121
globals: {
2222
'ts-jest': {
23-
tsconfig: '<rootDir>/tsconfig.json'
23+
tsconfig: "<rootDir>/tsconfig.test.json"
2424
}
2525
},
2626

web/tsconfig.test.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
// Use / as the root for tests so path-mapped imports from
5+
// ../shared and ../../common are within the configured rootDir.
6+
// This avoids TS6059 during ts-jest compilation.
7+
"rootDir": "..",
8+
"baseUrl": ".",
9+
"paths": {
10+
"common/*": ["../../common/src/*"],
11+
}
12+
},
13+
"include": ["tests/**/*.ts", "src/**/*.ts"]
14+
}

0 commit comments

Comments
 (0)