From 62ac24e127cf43114e140e41ea374ff024d870d7 Mon Sep 17 00:00:00 2001 From: Jason Palmer Date: Mon, 28 Jan 2019 12:07:11 -0500 Subject: [PATCH 1/3] Upgrade jest, jest-config, jest-validate to 24 --- .gitignore | 1 - .travis.yml | 1 + package.json | 8 ++++---- 3 files changed, 5 insertions(+), 5 deletions(-) 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..fa2040e 100644 --- a/package.json +++ b/package.json @@ -16,18 +16,18 @@ ], "scripts": { "test": "jest", - "pretest:ci": "npm install jest@$JEST_VERSION --no-save", + "pretest:ci": "npm uninstall jest && npm install jest@$JEST_VERSION --no-save", "test:ci": "jest --ci" }, "dependencies": { - "jest-config": "^23.6.0", - "jest-validate": "^23.0.1", + "jest-config": "^24.0.0", + "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" } } From d00e122b7ba6ca70fc7a67d5356a33981f77a90b Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Mon, 28 Jan 2019 20:27:54 +0100 Subject: [PATCH 2/3] chore: install babel-jest on CI to avoid hoisting bugs --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index fa2040e..5bd44e8 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ ], "scripts": { "test": "jest", - "pretest:ci": "npm uninstall jest && npm install jest@$JEST_VERSION --no-save", + "pretest:ci": "npm uninstall jest babel-jest && npm install jest@$JEST_VERSION babel-jest@$JEST_VERSION --no-save", "test:ci": "jest --ci" }, "dependencies": { @@ -27,6 +27,7 @@ "xml": "^1.0.1" }, "devDependencies": { + "babel-jest": "^24.0.0", "jest": "^24.0.0", "libxmljs": "^0.18.4" } From 6f270c09c7f60a0d9cc6267d76ee2addd92de28e Mon Sep 17 00:00:00 2001 From: Jason Palmer Date: Mon, 28 Jan 2019 14:46:06 -0500 Subject: [PATCH 3/3] Remove jest-config --- package.json | 4 +--- utils/getOptions.js | 2 +- utils/replaceRootDirInPath.js | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 utils/replaceRootDirInPath.js diff --git a/package.json b/package.json index 5bd44e8..72f95f5 100644 --- a/package.json +++ b/package.json @@ -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" } 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)), + ); + } +}