Skip to content

Commit

Permalink
Update to Jest 28 (#14490)
Browse files Browse the repository at this point in the history
Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com>
  • Loading branch information
JLHwung and nicolo-ribaudo committed May 4, 2022
1 parent e29e915 commit 12011ff
Show file tree
Hide file tree
Showing 4 changed files with 394 additions and 1,204 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -160,8 +160,8 @@ jobs:
- name: Install
run: |
yarn install
- name: Downgrade Jest for node <= 8
if: matrix.node-version == '6' || matrix.node-version == '8'
- name: Downgrade Jest for node <= 10
if: matrix.node-version == '6' || matrix.node-version == '8' || matrix.node-version == '10'
run: |
yarn remove jest
yarn add --dev jest@24
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -61,7 +61,7 @@
"gulp-plumber": "^1.2.1",
"husky": "^7.0.4",
"import-meta-resolve": "^1.1.1",
"jest": "^27.4.0",
"jest": "^28.0.3",
"jest-light-runner": "^0.2.1",
"jest-worker": "^27.4.0",
"lint-staged": "^9.2.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/babel-core/test/resolution.js
Expand Up @@ -354,7 +354,7 @@ describe("addon resolution", function () {
// because Jest 24 has an issue on setting the MODULE_NOT_FOUND error when the native
// `require.resolve` is provided.
// see https://github.com/babel/babel/pull/12439/files#r535996000
process.versions.node.startsWith("8.")
parseInt(process.versions.node, 10) <= 10
? /Cannot (?:find|resolve) module 'babel-preset-foo'/
: /Cannot (?:find|resolve) module 'babel-preset-foo'.*\n- If you want to resolve "foo", use "module:foo"/s,
);
Expand All @@ -370,7 +370,7 @@ describe("addon resolution", function () {
plugins: ["foo"],
});
}).toThrow(
process.versions.node.startsWith("8.")
parseInt(process.versions.node, 10) <= 10
? /Cannot (?:find|resolve) module 'babel-plugin-foo'/
: /Cannot (?:find|resolve) module 'babel-plugin-foo'.*\n- If you want to resolve "foo", use "module:foo"/s,
);
Expand All @@ -386,7 +386,7 @@ describe("addon resolution", function () {
presets: ["foo"],
});
}).toThrow(
process.versions.node.startsWith("8.")
parseInt(process.versions.node, 10) <= 10
? /Cannot (?:find|resolve) module 'babel-preset-foo'/
: /Cannot (?:find|resolve) module 'babel-preset-foo'.*\n- Did you mean "@babel\/foo"\?/s,
);
Expand All @@ -402,7 +402,7 @@ describe("addon resolution", function () {
plugins: ["foo"],
});
}).toThrow(
process.versions.node.startsWith("8.")
parseInt(process.versions.node, 10) <= 10
? /Cannot (?:find|resolve) module 'babel-plugin-foo'/
: /Cannot (?:find|resolve) module 'babel-plugin-foo'.*\n- Did you mean "@babel\/foo"\?/s,
);
Expand All @@ -418,7 +418,7 @@ describe("addon resolution", function () {
presets: ["testplugin"],
});
}).toThrow(
process.versions.node.startsWith("8.")
parseInt(process.versions.node, 10) <= 10
? /Cannot (?:find|resolve) module 'babel-preset-testplugin'/
: /Cannot (?:find|resolve) module 'babel-preset-testplugin'.*\n- Did you accidentally pass a plugin as a preset\?/s,
);
Expand All @@ -434,7 +434,7 @@ describe("addon resolution", function () {
plugins: ["testpreset"],
});
}).toThrow(
process.versions.node.startsWith("8.")
parseInt(process.versions.node, 10) <= 10
? /Cannot (?:find|resolve) module 'babel-plugin-testpreset'/
: /Cannot (?:find|resolve) module 'babel-plugin-testpreset'.*\n- Did you accidentally pass a preset as a plugin\?/s,
);
Expand Down

0 comments on commit 12011ff

Please sign in to comment.