Skip to content

Commit 6f270c0

Browse files
committed
Remove jest-config
1 parent d00e122 commit 6f270c0

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,16 @@
1616
],
1717
"scripts": {
1818
"test": "jest",
19-
"pretest:ci": "npm uninstall jest babel-jest && npm install jest@$JEST_VERSION babel-jest@$JEST_VERSION --no-save",
19+
"pretest:ci": "npm uninstall jest babel-jest && npm install jest@$JEST_VERSION",
2020
"test:ci": "jest --ci"
2121
},
2222
"dependencies": {
23-
"jest-config": "^24.0.0",
2423
"jest-validate": "^24.0.0",
2524
"mkdirp": "^0.5.1",
2625
"strip-ansi": "^4.0.0",
2726
"xml": "^1.0.1"
2827
},
2928
"devDependencies": {
30-
"babel-jest": "^24.0.0",
3129
"jest": "^24.0.0",
3230
"libxmljs": "^0.18.4"
3331
}

utils/getOptions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const fs = require('fs');
55

66
const constants = require('../constants/index');
77

8-
const { replaceRootDirInPath } = require('jest-config');
8+
const { replaceRootDirInPath } = require('./replaceRootDirInPath');
99

1010
function getEnvOptions() {
1111
const options = {};

utils/replaceRootDirInPath.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copied from https://github.com/facebook/jest/blob/master/packages/jest-config/src/utils.js
2+
// in order to reduce incompatible jest dependencies
3+
4+
const path = require('path');
5+
6+
module.exports = {
7+
replaceRootDirInPath : (
8+
rootDir,
9+
filePath,
10+
) => {
11+
if (!/^<rootDir>/.test(filePath)) {
12+
return filePath;
13+
}
14+
15+
return path.resolve(
16+
rootDir,
17+
path.normalize('./' + filePath.substr('<rootDir>'.length)),
18+
);
19+
}
20+
}

0 commit comments

Comments
 (0)