Skip to content

Commit

Permalink
Remove jest-config
Browse files Browse the repository at this point in the history
  • Loading branch information
palmerj3 committed Jan 28, 2019
1 parent d00e122 commit 6f270c0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@
],
"scripts": {
"test": "jest",
"pretest:ci": "npm uninstall jest babel-jest && npm install jest@$JEST_VERSION babel-jest@$JEST_VERSION --no-save",
"pretest:ci": "npm uninstall jest babel-jest && npm install jest@$JEST_VERSION",
"test:ci": "jest --ci"
},
"dependencies": {
"jest-config": "^24.0.0",
"jest-validate": "^24.0.0",
"mkdirp": "^0.5.1",
"strip-ansi": "^4.0.0",
"xml": "^1.0.1"
},
"devDependencies": {
"babel-jest": "^24.0.0",
"jest": "^24.0.0",
"libxmljs": "^0.18.4"
}
Expand Down
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 6f270c0

Please sign in to comment.