Skip to content

Commit dfa75fa

Browse files
Update tests
1 parent df16abc commit dfa75fa

File tree

9 files changed

+45
-5
lines changed

9 files changed

+45
-5
lines changed

packages/babel-core/test/async.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ describe("asynchronicity", () => {
217217
describe(".mjs files", () => {
218218
if (process.env.IS_PUBLISH) {
219219
it("called synchronously", async () => {
220-
process.chdir("plugin-mjs");
220+
process.chdir("plugin-mjs-native");
221221

222222
await expect(compileInSpawedProcess(false)).rejects.toThrow(
223223
`[BABEL]: You appear to be using a native ECMAScript module plugin, which is` +
@@ -226,7 +226,7 @@ describe("asynchronicity", () => {
226226
});
227227

228228
it("called asynchronously", async () => {
229-
process.chdir("plugin-mjs");
229+
process.chdir("plugin-mjs-native");
230230

231231
await expect(compileInSpawedProcess(true)).resolves.toMatchObject({
232232
code: `"success"`,
@@ -300,7 +300,7 @@ describe("asynchronicity", () => {
300300
describe(".mjs files", () => {
301301
if (process.env.IS_PUBLISH) {
302302
it("called synchronously", async () => {
303-
process.chdir("preset-mjs");
303+
process.chdir("preset-mjs-native");
304304

305305
await expect(compileInSpawedProcess(false)).rejects.toThrow(
306306
`[BABEL]: You appear to be using a native ECMAScript module preset, which is` +
@@ -309,15 +309,15 @@ describe("asynchronicity", () => {
309309
});
310310

311311
it("called asynchronously", async () => {
312-
process.chdir("preset-mjs");
312+
process.chdir("preset-mjs-native");
313313

314314
await expect(compileInSpawedProcess(true)).resolves.toMatchObject({
315315
code: `"success"`,
316316
});
317317
});
318318

319319
it("must use the 'default' export", async () => {
320-
process.chdir("preset-mjs-named-exports");
320+
process.chdir("preset-mjs-named-exports-native");
321321

322322
await expect(compileInSpawedProcess(true)).rejects.toThrow(
323323
`Unexpected falsy value: undefined`,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
plugins: ["./plugin.mjs"],
3+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function plugin({ types: t }) {
2+
return {
3+
visitor: {
4+
Program(path) {
5+
path.pushContainer("body", t.stringLiteral("success"));
6+
},
7+
},
8+
};
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ["./preset.mjs"],
3+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function plugin({ types: t }) {
2+
return {
3+
visitor: {
4+
Program(path) {
5+
path.pushContainer("body", t.stringLiteral("success"));
6+
},
7+
},
8+
};
9+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const plugins = ["./plugin.mjs"];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ["./preset.mjs"],
3+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function plugin({ types: t }) {
2+
return {
3+
visitor: {
4+
Program(path) {
5+
path.pushContainer("body", t.stringLiteral("success"));
6+
},
7+
},
8+
};
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default () => ({
2+
plugins: ["./plugin.mjs"]
3+
});

0 commit comments

Comments
 (0)