Skip to content

Commit 87c258c

Browse files
committed
fix: ci scripts
1 parent 62bcd4c commit 87c258c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

jest-legacy.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
'use strict';
22

3+
const nodeVersion = process.versions.node.split('.').map(Number)[0];
4+
35
/** @type {import('jest').Config} */
4-
module.exports = {
6+
const config = {
57
testEnvironment: 'node',
68
testMatch: ['<rootDir>/tslib/test/**/*.{spec,test}.js'],
79
setupFiles: ['<rootDir>/tslib/test/jest.setup.js'],
@@ -14,3 +16,10 @@ module.exports = {
1416
'^@enum-plus': '<rootDir>/lib',
1517
},
1618
};
19+
if (nodeVersion < 14) {
20+
config.setupFiles = ['<rootDir>/tslib/test/jest.setup.js'];
21+
} else {
22+
config.setupFilesAfterEnv = ['<rootDir>/tslib/test/jest.setup.js'];
23+
}
24+
25+
module.exports = config;

0 commit comments

Comments
 (0)