Skip to content

Commit

Permalink
chore: check jest version in babel-core test
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Apr 25, 2022
1 parent 6a08bc8 commit e848a79
Showing 1 changed file with 6 additions and 6 deletions.
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.")
jest.getVersion().startsWith("24.")
? /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.")
jest.getVersion().startsWith("24.")
? /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.")
jest.getVersion().startsWith("24.")
? /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.")
jest.getVersion().startsWith("24.")
? /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.")
jest.getVersion().startsWith("24.")
? /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.")
jest.getVersion().startsWith("24.")
? /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 e848a79

Please sign in to comment.