Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Apr 2, 2024
1 parent db2e692 commit 9d3bde8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ negative:
type: ReferenceError
---*/

// TODO: not.toThrow -> toThrow
// This test currently fails due to `transform-async-generator-functions` being transformed in `Program.enter`.
expect(() => {
switch (0) { default: async function * x() {} }
x;
}).toThrow(ReferenceError);
}).not.toThrow(ReferenceError);

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plugins": [
"transform-block-scoped-functions",
"transform-block-scoping",
"transform-async-generator-functions"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ negative:
expect(() => {
switch (0) {
default:
async function* x() {}
function x() {
return _x.apply(this, arguments);
}
function _x() {
_x = babelHelpers.wrapAsyncGenerator(function* () {});
return _x.apply(this, arguments);
}
}
x;
}).toThrow(ReferenceError);

0 comments on commit 9d3bde8

Please sign in to comment.