diff --git a/.gitignore b/.gitignore index 9a8bacc..79d372d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ node_modules -yarn.lock junit.xml diff --git a/.travis.yml b/.travis.yml index 13f05e1..709c63c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/package.json b/package.json index 1d27b2d..72f95f5 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/utils/getOptions.js b/utils/getOptions.js index 131e1c8..6bfbe26 100644 --- a/utils/getOptions.js +++ b/utils/getOptions.js @@ -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 = {}; diff --git a/utils/replaceRootDirInPath.js b/utils/replaceRootDirInPath.js new file mode 100644 index 0000000..1c2ce6b --- /dev/null +++ b/utils/replaceRootDirInPath.js @@ -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 (!/^/.test(filePath)) { + return filePath; + } + + return path.resolve( + rootDir, + path.normalize('./' + filePath.substr(''.length)), + ); + } +}