Skip to content

Commit c871df5

Browse files
committed
chore(tests): Fix jest yaml resolution in schema-compiler
1 parent 1cfe4c2 commit c871df5

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

packages/cubejs-schema-compiler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"moduleNameMapper": {
116116
"^axios$": "<rootDir>/../../node_modules/axios/dist/node/axios.cjs",
117117
"^uuid$": "<rootDir>/../../node_modules/uuid/dist/index.js",
118-
"^yaml$": "<rootDir>/../../node_modules/yaml/dist/index.js"
118+
"^yaml$": "<rootDir>/node_modules/yaml/dist/index.js"
119119
},
120120
"snapshotFormat": {
121121
"escapeString": true,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/** @type {import('jest').Config} */
2+
module.exports = {
3+
testEnvironment: 'node',
4+
setupFilesAfterEnv: [
5+
'<rootDir>/dist/test/setup.js'
6+
],
7+
collectCoverage: true,
8+
coverageReporters: [
9+
'text',
10+
'html',
11+
'lcov'
12+
],
13+
coverageDirectory: 'coverage/',
14+
collectCoverageFrom: [
15+
'dist/src/**/*.js',
16+
'dist/src/**/*.ts'
17+
],
18+
coveragePathIgnorePatterns: [
19+
'.*\\.d\\.ts'
20+
],
21+
moduleNameMapper: {
22+
// Can not use jest config in package.json because of need of require.resolve(...)
23+
'^uuid$': require.resolve('uuid'),
24+
'^yaml$': require.resolve('yaml'),
25+
}
26+
};

packages/cubejs-server-core/package.json

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,28 +77,5 @@
7777
"license": "Apache-2.0",
7878
"eslintConfig": {
7979
"extends": "../cubejs-linter"
80-
},
81-
"jest": {
82-
"testEnvironment": "node",
83-
"setupFilesAfterEnv": [
84-
"<rootDir>/dist/test/setup.js"
85-
],
86-
"collectCoverage": true,
87-
"coverageReporters": [
88-
"text",
89-
"html",
90-
"lcov"
91-
],
92-
"coverageDirectory": "coverage/",
93-
"collectCoverageFrom": [
94-
"dist/src/**/*.js",
95-
"dist/src/**/*.ts"
96-
],
97-
"coveragePathIgnorePatterns": [
98-
".*\\.d\\.ts"
99-
],
100-
"moduleNameMapper": {
101-
"^uuid$": "<rootDir>/../../node_modules/uuid/dist/index.js"
102-
}
10380
}
10481
}

0 commit comments

Comments
 (0)