From 672653022923c6fbacb3cbdc47a296ffd9c72f63 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Thu, 24 May 2018 15:01:11 +0200 Subject: [PATCH] fix(tests): run all test with Babel 7 Temporarily disable xo-web tests which uses Babel 6. --- babel.config.js | 5 +++++ package.json | 15 ++++----------- yarn.lock | 24 +++++------------------- 3 files changed, 14 insertions(+), 30 deletions(-) create mode 100644 babel.config.js diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 000000000..aabb9b298 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + // Necessary for jest to be able to find the `.babelrc.js` closest to the file + // instead of only the one in this directory. + babelrcRoots: true, +} diff --git a/package.json b/package.json index 58fcf7927..9d7dc366c 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,10 @@ { "devDependencies": { + "@babel/core": "^7.0.0-beta.49", "@babel/register": "^7.0.0-beta.49", - "babel-7-jest": "^21.3.2", + "babel-core": "^7.0.0-0", "babel-eslint": "^8.1.2", + "babel-jest": "^23.0.1", "benchmark": "^2.1.4", "eslint": "^4.14.0", "eslint-config-standard": "^11.0.0-beta.0", @@ -28,8 +30,7 @@ "jest": { "collectCoverage": true, "projects": [ - "", - "/packages/xo-web" + "" ], "testEnvironment": "node", "testPathIgnorePatterns": [ @@ -38,14 +39,6 @@ ], "testRegex": "\\.spec\\.js$", "transform": { - "/@xen-orchestra/cron/.+\\.jsx?$": "babel-7-jest", - "/@xen-orchestra/fs/.+\\.jsx?$": "babel-7-jest", - "/packages/complex-matcher/.+\\.jsx?$": "babel-7-jest", - "/packages/value-matcher/.+\\.jsx?$": "babel-7-jest", - "/packages/vhd-lib/.+\\.jsx?$": "babel-7-jest", - "/packages/xo-cli/.+\\.jsx?$": "babel-7-jest", - "/packages/xo-server/.+\\.jsx?$": "babel-7-jest", - "/packages/xo-vmdk-to-vhd/.+\\.jsx?$": "babel-7-jest", "\\.jsx?$": "babel-jest" } }, diff --git a/yarn.lock b/yarn.lock index b6eaa6581..7167be9df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1389,13 +1389,6 @@ aws4@^1.2.1, aws4@^1.6.0: version "1.7.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" -babel-7-jest@^21.3.2: - version "21.3.3" - resolved "https://registry.yarnpkg.com/babel-7-jest/-/babel-7-jest-21.3.3.tgz#1beaf521b1d340b1ee4c76c3cb6603112ef6fb8c" - dependencies: - babel-plugin-istanbul "^4.1.5" - babel-preset-jest "^21.2.0" - babel-cli@^6.18.0, babel-cli@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" @@ -1449,6 +1442,10 @@ babel-core@^6.0.0, babel-core@^6.26.0: slash "^1.0.0" source-map "^0.5.7" +babel-core@^7.0.0-0: + version "7.0.0-bridge.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" + babel-eslint@^8.1.2: version "8.2.3" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.3.tgz#1a2e6681cc9bc4473c32899e59915e19cd6733cf" @@ -1629,7 +1626,7 @@ babel-plugin-dev@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-dev/-/babel-plugin-dev-1.0.0.tgz#6b1baeadc1740fc894082a450d297e49469dd0de" -babel-plugin-istanbul@^4.1.5, babel-plugin-istanbul@^4.1.6: +babel-plugin-istanbul@^4.1.6: version "4.1.6" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" dependencies: @@ -1638,10 +1635,6 @@ babel-plugin-istanbul@^4.1.5, babel-plugin-istanbul@^4.1.6: istanbul-lib-instrument "^1.10.1" test-exclude "^4.2.1" -babel-plugin-jest-hoist@^21.2.0: - version "21.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-21.2.0.tgz#2cef637259bd4b628a6cace039de5fcd14dbb006" - babel-plugin-jest-hoist@^23.0.1: version "23.0.1" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.0.1.tgz#eaa11c964563aea9c21becef2bdf7853f7f3c148" @@ -2082,13 +2075,6 @@ babel-preset-flow@^6.23.0: dependencies: babel-plugin-transform-flow-strip-types "^6.22.0" -babel-preset-jest@^21.2.0: - version "21.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-21.2.0.tgz#ff9d2bce08abd98e8a36d9a8a5189b9173b85638" - dependencies: - babel-plugin-jest-hoist "^21.2.0" - babel-plugin-syntax-object-rest-spread "^6.13.0" - babel-preset-jest@^23.0.1: version "23.0.1" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.0.1.tgz#631cc545c6cf021943013bcaf22f45d87fe62198"