Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoventurini committed May 27, 2024
1 parent 6ea8f4c commit 3bed2ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/tla/exported-declaration-deep.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const value = Math.max(false ? 777 : await Promise.resolve(12), 2);
5 changes: 5 additions & 0 deletions test/top-level-await-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ import { importSync, importAsync, importAsyncEvaluated } from './tla/nested/pare
assert(exports.redirected === 'value');
})

it('should detect tla on exported declarations (deep)', async () => {
const exports = await require('./tla/exported-declaration-deep.js');
assert(exports.value === 12);
});

it('should not detect tla if they are inside any function type', async () => {
const exports = require('./tla/await-inside-function.js');
assert(!(exports instanceof Promise))
Expand Down

0 comments on commit 3bed2ec

Please sign in to comment.