Skip to content

Commit

Permalink
WIP: adds two failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agilgur5 committed Mar 20, 2022
1 parent d424cac commit 1dc84e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"targets": {
"chrome": 70
},
"plugins": [
[
"@@/polyfill-regenerator",
Expand All @@ -11,10 +14,7 @@
[
"@babel/preset-env",
{
"modules": false,
"targets": {
"chrome": 70
}
"modules": false
}
]
]
Expand Down
11 changes: 11 additions & 0 deletions packages/babel-plugin-polyfill-regenerator/test/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import polyfillRegenerator from "../lib";
function transform(code, opts) {
return babel.transformSync(code, {
configFile: false,
targets: { chrome: 50 },
plugins: [[polyfillRegenerator, opts]],
});
}
Expand All @@ -18,3 +19,13 @@ describe("targets", () => {
).toThrow(/targets/);
});
});

describe("top-level targets", () => {
it("is supported", () => {
expect(() =>
transform("code", {
method: "usage-pure",
}),
).not.toThrow(/targets/);
});
})

0 comments on commit 1dc84e6

Please sign in to comment.