Skip to content

Commit 62a26c6

Browse files
committed
Use moduleNameMapper to avoid circular deps
1 parent 7fdce33 commit 62a26c6

7 files changed

Lines changed: 27 additions & 11 deletions

File tree

pgpm/cli/jest.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ module.exports = {
77
'ts-jest',
88
{
99
babelConfig: false,
10-
tsconfig: 'tsconfig.json',
10+
tsconfig: 'tsconfig.test.json',
1111
},
1212
],
1313
},
1414
transformIgnorePatterns: [`/node_modules/*`],
1515
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
1616
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
17+
moduleNameMapper: {
18+
'^pgsql-test$': '<rootDir>/../../postgres/pgsql-test/src',
19+
},
1720
modulePathIgnorePatterns: ['dist/*'],
1821
};

pgpm/cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"glob": "^13.0.6",
4343
"makage": "^0.1.12",
4444
"pg": "^8.20.0",
45-
"pgsql-test": "workspace:^",
4645
"ts-node": "^10.9.2"
4746
},
4847
"dependencies": {

pgpm/cli/tsconfig.test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"paths": {
5+
"pgsql-test": ["../../postgres/pgsql-test/src"]
6+
}
7+
},
8+
"include": ["src", "__tests__"]
9+
}

pgpm/core/jest.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ module.exports = {
77
'ts-jest',
88
{
99
babelConfig: false,
10-
tsconfig: 'tsconfig.json',
10+
tsconfig: 'tsconfig.test.json',
1111
},
1212
],
1313
},
1414
transformIgnorePatterns: [`/node_modules/*`],
1515
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
1616
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
17+
moduleNameMapper: {
18+
'^pgsql-test$': '<rootDir>/../../postgres/pgsql-test/src',
19+
},
1720
modulePathIgnorePatterns: ['dist/*']
1821
};

pgpm/core/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
"@types/pg": "^8.18.0",
4646
"copyfiles": "^2.4.1",
4747
"inquirerer": "^4.7.0",
48-
"makage": "^0.1.12",
49-
"pgsql-test": "workspace:^"
48+
"makage": "^0.1.12"
5049
},
5150
"dependencies": {
5251
"@pgpmjs/env": "workspace:^",

pgpm/core/tsconfig.test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"paths": {
5+
"pgsql-test": ["../../postgres/pgsql-test/src"]
6+
}
7+
},
8+
"include": ["src", "__tests__"]
9+
}

pnpm-lock.yaml

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)