Skip to content

Commit f057e7d

Browse files
committed
test: require loop
1 parent a6f8f9f commit f057e7d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/specs/smoke.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,8 @@ export default testSuite(async ({ describe }, { tsx, supports, version }: NodeAp
540540
expect(p.failed).toBe(false);
541541
});
542542
}
543+
544+
// https://github.com/privatenumber/tsx/issues/727
543545
describe('CJS & ESM race condition', ({ test }) => {
544546
test('explicit extension', async ({ onTestFail }) => {
545547
await using fixture = await createFixture({
@@ -599,5 +601,22 @@ export default testSuite(async ({ describe }, { tsx, supports, version }: NodeAp
599601
expect(p.failed).toBe(false);
600602
});
601603
});
604+
605+
// https://github.com/privatenumber/tsx/issues/722
606+
test('handles require loop', async ({ onTestFail }) => {
607+
await using fixture = await createFixture({
608+
'index.ts': 'require("./a.js")',
609+
'a.js': 'require("./b.js")',
610+
'b.js': 'require("./a.js")',
611+
});
612+
613+
const p = await tsx(['index.ts'], {
614+
cwd: fixture.path,
615+
});
616+
onTestFail(() => {
617+
console.log(p);
618+
});
619+
expect(p.failed).toBe(false);
620+
});
602621
});
603622
});

0 commit comments

Comments
 (0)