Skip to content

Commit ab74044

Browse files
committed
chore(async-rewriter): add test for fully synchronous cb passed to builtin
1 parent 9a2b87b commit ab74044

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/async-rewriter2/src/async-writer-babel.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,13 @@ describe('AsyncWriter', function () {
482482
);
483483
});
484484

485+
it('handles sync callbacks for builtin functions', async function () {
486+
const ret = runTranspiledCode(
487+
'["abc", "def"].filter(x => x.endsWith("f"))'
488+
);
489+
expect(await ret).to.deep.equal(['def']);
490+
});
491+
485492
it('supports typeof for un-defined variables', function () {
486493
expect(runTranspiledCode('typeof nonexistent')).to.equal('undefined');
487494
});

0 commit comments

Comments
 (0)