Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion jest.base.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
/** @type {import('jest').Config} */
/**
* Base config for packages that test their COMPILED output. It declares no
* `preset` and no `transform`, so the TypeScript under `test/` cannot execute
* here — run `yarn tsc` first, and expect suites to run from `dist/test`.
*
* `testMatch` is deliberately left to each package rather than set here:
* several of them keep integration suites next to their unit ones and split the
* two with the path argument in their `unit` / `integration` scripts. A pattern
* hoisted into this file would apply to packages that have no such argument,
* enrolling suites that need live warehouse credentials.
*
* So a package extending this should declare its own `testMatch` pointing into
* `dist/`. Without one, jest's default picks up the untransformable sources
* under `test/` and a bare `jest` fails on `import` — the path argument in the
* npm script is then the only thing keeping the suite runnable.
Comment thread
igorlukanin marked this conversation as resolved.
*
* @type {import('jest').Config}
*/
module.exports = {
testEnvironment: 'node',
collectCoverage: true,
Expand Down
12 changes: 12 additions & 0 deletions packages/cubejs-athena-driver/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const base = require('../../jest.base.config');
Comment thread
igorlukanin marked this conversation as resolved.

/** @type {import('jest').Config} */
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output. This names every one the package has;
// the `unit` / `integration` scripts each pass a path to select their own.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
};
3 changes: 0 additions & 3 deletions packages/cubejs-athena-driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,5 @@
"eslintConfig": {
"extends": "../cubejs-linter"
},
"jest": {
"testEnvironment": "node"
},
"license": "Apache-2.0"
}
5 changes: 5 additions & 0 deletions packages/cubejs-backend-cloud/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ const base = require('../../jest.base.config');
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output — the sources under test/ have no
// transform and cannot execute.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
};
5 changes: 5 additions & 0 deletions packages/cubejs-cli/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ const base = require('../../jest.base.config');
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output — the sources under test/ have no
// transform and cannot execute.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
};
5 changes: 5 additions & 0 deletions packages/cubejs-clickhouse-driver/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ const base = require('../../jest.base.config');
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output. This names every one the package has;
// the `unit` / `integration` scripts each pass a path to select their own.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
};
12 changes: 12 additions & 0 deletions packages/cubejs-crate-driver/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const base = require('../../jest.base.config');

/** @type {import('jest').Config} */
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output. This names every one the package has;
// the `unit` / `integration` scripts each pass a path to select their own.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
};
3 changes: 0 additions & 3 deletions packages/cubejs-crate-driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
"publishConfig": {
"access": "public"
},
"jest": {
"testEnvironment": "node"
},
"eslintConfig": {
"extends": "../cubejs-linter"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/cubejs-dremio-driver/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ const base = require('../../jest.base.config');
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output. This names every one the package has;
// the `unit` / `integration` scripts each pass a path to select their own.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
setupFiles: [
...base.setupFiles,
'./test/test-env.js'
],
Comment thread
claude[bot] marked this conversation as resolved.
transformIgnorePatterns: [
Expand Down
12 changes: 12 additions & 0 deletions packages/cubejs-jdbc-driver/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const base = require('../../jest.base.config');

/** @type {import('jest').Config} */
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output — the sources under test/ have no
// transform and cannot execute.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
};
3 changes: 0 additions & 3 deletions packages/cubejs-jdbc-driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
"eslintConfig": {
"extends": "../cubejs-linter"
},
"jest": {
"testEnvironment": "node"
},
"devDependencies": {
"@cubejs-backend/linter": "1.7.16",
"@types/node": "^22",
Expand Down
5 changes: 5 additions & 0 deletions packages/cubejs-ksql-driver/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ const base = require('../../jest.base.config');
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output — the sources under test/ have no
// transform and cannot execute.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
moduleNameMapper: {
...base.moduleNameMapper,
'^axios$': require.resolve('axios'),
Expand Down
5 changes: 5 additions & 0 deletions packages/cubejs-pinot-driver/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ const base = require('../../jest.base.config');
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output. This names every one the package has;
// the `unit` / `integration` scripts each pass a path to select their own.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
};
5 changes: 5 additions & 0 deletions packages/cubejs-prestodb-driver/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ const base = require('../../jest.base.config');
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output. This names every one the package has;
// the `unit` / `integration` scripts each pass a path to select their own.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
};
5 changes: 5 additions & 0 deletions packages/cubejs-schema-compiler/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ const base = require('../../jest.base.config');
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output. This names every one the package has;
// the `unit` / `integration` scripts each pass a path to select their own.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
collectCoverageFrom: [
...base.collectCoverageFrom,
'!dist/src/parser/GenericSql*.js',
Expand Down
5 changes: 5 additions & 0 deletions packages/cubejs-server-core/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ const base = require('../../jest.base.config');
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output — the sources under test/ have no
// transform and cannot execute.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
setupFilesAfterEnv: [
'<rootDir>/dist/test/setup.js'
],
Expand Down
12 changes: 12 additions & 0 deletions packages/cubejs-trino-driver/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const base = require('../../jest.base.config');

/** @type {import('jest').Config} */
module.exports = {
...base,
rootDir: '.',
// Suites run from the compiled output. This names every one the package has;
// the `unit` / `integration` scripts each pass a path to select their own.
testMatch: [
'<rootDir>/dist/test/**/*.{test,spec}.{ts,js}'
],
};
Loading