Skip to content

Commit

Permalink
test: add an async syntax regression test
Browse files Browse the repository at this point in the history
- cover the bases and ensure async is supported too, not just generators

- use some syntax from a bug report that would cause async-to-promises
  to produce invalid JS and Rollup to subsequently error out
  • Loading branch information
agilgur5 committed Sep 20, 2020
1 parent 2f8544d commit 814c83b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/e2e/fixtures/build-default/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import './syntax/optional-chaining';

import './syntax/jsx-import/JSX-import-JSX';

import './syntax/async';
export { testGenerator } from './syntax/generator';

export { foo } from './foo';
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/fixtures/build-default/src/syntax/async.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// regression test for async/await
// code inspired by https://github.com/formium/tsdx/issues/869
(async () => {
await Promise.resolve();
console.log('a side effect to make sure this is output');
})();

0 comments on commit 814c83b

Please sign in to comment.