Skip to content

Commit b35bc73

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

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
@@ -495,6 +495,13 @@ describe('AsyncWriter', function () {
495495
);
496496
});
497497

498+
it('handles sync callbacks for builtin functions', async function () {
499+
const ret = runTranspiledCode(
500+
'["abc", "def"].filter(x => x.endsWith("f"))'
501+
);
502+
expect(await ret).to.deep.equal(['def']);
503+
});
504+
498505
it('supports typeof for un-defined variables', function () {
499506
expect(runTranspiledCode('typeof nonexistent')).to.equal('undefined');
500507
});

0 commit comments

Comments
 (0)