Skip to content

Commit b669bbe

Browse files
authored
Merge pull request #81 from palmerj3/upgradeJest
Upgrade jest, jest-config, jest-validate to 24
2 parents 9882c33 + 6f270c0 commit b669bbe

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
node_modules
2-
yarn.lock
32
junit.xml

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ node_js:
77
env:
88
- JEST_VERSION=^22.0.0
99
- JEST_VERSION=^23.0.0
10+
- JEST_VERSION=^24.0.0
1011
script:
1112
- npm run test:ci

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@
1616
],
1717
"scripts": {
1818
"test": "jest",
19-
"pretest:ci": "npm install 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": "^23.6.0",
24-
"jest-validate": "^23.0.1",
23+
"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-
"jest": "^22.4.3",
29+
"jest": "^24.0.0",
3130
"libxmljs": "^0.18.4"
3231
}
3332
}

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)