Skip to content

Commit

Permalink
Merge pull request #81 from palmerj3/upgradeJest
Browse files Browse the repository at this point in the history
Upgrade jest, jest-config, jest-validate to 24
  • Loading branch information
palmerj3 committed Jan 28, 2019
2 parents 9882c33 + 6f270c0 commit b669bbe
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules
yarn.lock
junit.xml
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ node_js:
env:
- JEST_VERSION=^22.0.0
- JEST_VERSION=^23.0.0
- JEST_VERSION=^24.0.0
script:
- npm run test:ci
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@
],
"scripts": {
"test": "jest",
"pretest:ci": "npm install jest@$JEST_VERSION --no-save",
"pretest:ci": "npm uninstall jest babel-jest && npm install jest@$JEST_VERSION",
"test:ci": "jest --ci"
},
"dependencies": {
"jest-config": "^23.6.0",
"jest-validate": "^23.0.1",
"jest-validate": "^24.0.0",
"mkdirp": "^0.5.1",
"strip-ansi": "^4.0.0",
"xml": "^1.0.1"
},
"devDependencies": {
"jest": "^22.4.3",
"jest": "^24.0.0",
"libxmljs": "^0.18.4"
}
}
2 changes: 1 addition & 1 deletion utils/getOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const fs = require('fs');

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

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

function getEnvOptions() {
const options = {};
Expand Down
20 changes: 20 additions & 0 deletions utils/replaceRootDirInPath.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copied from https://github.com/facebook/jest/blob/master/packages/jest-config/src/utils.js
// in order to reduce incompatible jest dependencies

const path = require('path');

module.exports = {
replaceRootDirInPath : (
rootDir,
filePath,
) => {
if (!/^<rootDir>/.test(filePath)) {
return filePath;
}

return path.resolve(
rootDir,
path.normalize('./' + filePath.substr('<rootDir>'.length)),
);
}
}

0 comments on commit b669bbe

Please sign in to comment.