Skip to content

Commit 52c5aed

Browse files
authored
Turbopack: add test for reexport cycles (#79792)
### What? Add a test case to make sure the compilation doesn't hang on reexport cycles
1 parent 4ce2881 commit 52c5aed

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { a } from './b.js'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { a } from './a.js'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// TODO this test has not the expected behavior yet. But it's still here to check if the compilation doesn't crash or hang.
2+
3+
it('should error on reexport cycles', async () => {
4+
await import('./a')
5+
// TODO this is not working yet. We need to throw an SyntaxError in that case.
6+
// await expect(import('./a')).rejects.toThrowError('')
7+
})
8+
9+
it('should error on self reexport cycle', async () => {
10+
await import('./self')
11+
// TODO this is not working yet. We need to throw an SyntaxError in that case.
12+
// await expect(import('./self')).rejects.toThrowError('')
13+
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { a } from './self.js'

0 commit comments

Comments
 (0)