Skip to content

Commit 0d613b7

Browse files
authored
chore(ci): Switch few packages unit tests to ts-jest (#10037)
* chore(ci): Switch backend-shared unit tests to ts-jest * chore(ci): Switch query-orchestrator unit tests to ts-jest * chore(ci): Switch base-driver unit tests to ts-jest
1 parent e30ddb0 commit 0d613b7

File tree

8 files changed

+40
-8
lines changed

8 files changed

+40
-8
lines changed

packages/cubejs-backend-shared/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const base = require('../../jest.base.config');
1+
const base = require('../../jest.base-ts.config');
22

33
/** @type {import('jest').Config} */
44
module.exports = {

packages/cubejs-backend-shared/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"watch": "tsc -w",
1111
"lint": "eslint src/* --ext .ts",
1212
"lint:fix": "eslint --fix src/* --ext .ts",
13-
"unit": "jest --coverage dist/test"
13+
"unit": "jest --coverage"
1414
},
1515
"files": [
1616
"README.md",
@@ -32,6 +32,7 @@
3232
"@types/shelljs": "^0.8.5",
3333
"@types/throttle-debounce": "^2.1.0",
3434
"jest": "^29",
35+
"ts-jest": "^29",
3536
"typescript": "~5.2.2"
3637
},
3738
"dependencies": {
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
const base = require('../../jest.base.config');
1+
const base = require('../../jest.base-ts.config');
22

33
/** @type {import('jest').Config} */
44
module.exports = {
55
...base,
66
rootDir: '.',
7+
transform: {
8+
'^.+\\.ts$': ['ts-jest', {
9+
tsconfig: '<rootDir>/tsconfig.jest.json'
10+
}],
11+
},
712
};

packages/cubejs-base-driver/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"tsc": "tsc",
1919
"watch": "tsc -w",
2020
"test": "npm run unit && npm run integration",
21-
"unit": "jest --runInBand --coverage --verbose dist/test/unit",
21+
"unit": "jest --runInBand --coverage --verbose test/unit",
2222
"lint": "eslint src/* test/* --ext .ts,.js",
2323
"lint:fix": "eslint --fix src/* test/* --ext .ts,.js"
2424
},
@@ -41,6 +41,7 @@
4141
"@types/jest": "^29",
4242
"@types/node": "^20",
4343
"jest": "^29",
44+
"ts-jest": "^29",
4445
"typescript": "~5.2.2"
4546
},
4647
"license": "Apache-2.0",
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+
"module": "CommonJS",
5+
"paths": {
6+
"@cubejs-backend/shared": ["../cubejs-backend-shared/src"]
7+
}
8+
}
9+
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
const base = require('../../jest.base.config');
1+
const base = require('../../jest.base-ts.config');
22

33
/** @type {import('jest').Config} */
44
module.exports = {
55
...base,
66
rootDir: '.',
7+
transform: {
8+
'^.+\\.ts$': ['ts-jest', {
9+
tsconfig: '<rootDir>/tsconfig.jest.json'
10+
}],
11+
},
712
};

packages/cubejs-query-orchestrator/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"tsc": "tsc",
1919
"watch": "tsc -w",
2020
"test": "npm run unit && npm run integration",
21-
"unit": "jest --runInBand --forceExit --coverage --verbose dist/test/unit",
22-
"integration": "jest --runInBand --verbose dist/test/integration",
23-
"integration:cubestore": "jest --runInBand --verbose dist/test/integration/cubestore",
21+
"unit": "jest --runInBand --forceExit --coverage --verbose test/unit",
22+
"integration": "jest --runInBand --verbose test/integration",
23+
"integration:cubestore": "jest --runInBand --verbose test/integration/cubestore",
2424
"lint": "eslint src/* test/* --ext .ts,.js",
2525
"lint:fix": "eslint --fix src/* test/* --ext .ts,.js"
2626
},
@@ -43,6 +43,7 @@
4343
"@types/ramda": "^0.27.32",
4444
"@types/uuid": "^8.3.0",
4545
"jest": "^29",
46+
"ts-jest": "^29",
4647
"typescript": "~5.2.2"
4748
},
4849
"license": "Apache-2.0",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "CommonJS",
5+
"paths": {
6+
"@cubejs-backend/shared": ["../cubejs-backend-shared/src"],
7+
"@cubejs-backend/base-driver": ["../cubejs-base-driver/src"]
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)