Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude import() tests from pubilsh build #10995

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -212,7 +212,7 @@ prepublish-build: clean-lib clean-runtime-helpers
prepublish:
$(MAKE) bootstrap-only
$(MAKE) prepublish-build
$(MAKE) test
IS_PUBLISH=true $(MAKE) test

new-version:
git pull --rebase
Expand Down
30 changes: 30 additions & 0 deletions packages/babel-core/test/config-chain.js
Expand Up @@ -1044,6 +1044,10 @@ describe("buildConfigChain", function() {
);
const filename = tmp("src.js");

// We can't transpile import() while publishing, and it isn't supported
// by jest.
if (process.env.IS_PUBLISH && name === "babel.config.mjs") return;

await config(name);

expect(await loadOptionsAsync({ filename, cwd })).toEqual({
Expand All @@ -1067,6 +1071,15 @@ describe("buildConfigChain", function() {
`babel-test-dup-config-${name1}-${name2}`,
);

// We can't transpile import() while publishing, and it isn't supported
// by jest.
if (
process.env.IS_PUBLISH &&
(name1 === "babel.config.mjs" || name2 === "babel.config.mjs")
) {
return;
}

await Promise.all([config(name1), config(name2)]);

await expect(
Expand Down Expand Up @@ -1124,6 +1137,10 @@ describe("buildConfigChain", function() {
);
const filename = tmp("src.js");

// We can't transpile import() while publishing, and it isn't supported
// by jest.
if (process.env.IS_PUBLISH && name === ".babelrc.mjs") return;

await config(name);

expect(await loadOptionsAsync({ filename, cwd })).toEqual({
Expand Down Expand Up @@ -1157,6 +1174,15 @@ describe("buildConfigChain", function() {
`babel-test-dup-config-${name1}-${name2}`,
);

// We can't transpile import() while publishing, and it isn't supported
// by jest.
if (
process.env.IS_PUBLISH &&
(name1 === ".babelrc.mjs" || name2 === ".babelrc.mjs")
) {
return;
}

await Promise.all([config(name1), config(name2)]);

await expect(
Expand Down Expand Up @@ -1187,6 +1213,10 @@ describe("buildConfigChain", function() {
`("should show helpful errors for $config", async ({ dir, error }) => {
const filename = fixture("config-files", dir, "src.js");

// We can't transpile import() while publishing, and it isn't supported
// by jest.
if (process.env.IS_PUBLISH && dir === "babelrc-mjs-error") return;

await expect(
loadOptionsAsync({ filename, cwd: path.dirname(filename) }),
).rejects.toThrow(error);
Expand Down