Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { b } from './b.js'

await Promise.resolve()

export const a = 'a'
export const getB = () => b
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { a } from './a.js'

await Promise.resolve()

export const b = 'b'
export const getA = () => a
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { a, getB } from './a.js'
import { b, getA } from './b.js'

export { a, b, getA, getB }
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,17 @@ describe('module runner initialization', async () => {
expect(action).toBeDefined()
})

it('resolves circular imports between modules with top-level await', async ({
runner,
}) => {
const mod = await runner.import('/fixtures/tla-circular/index.js')

expect(mod.a).toBe('a')
expect(mod.b).toBe('b')
expect(mod.getA()).toBe('a')
expect(mod.getB()).toBe('b')
})

it('this of the exported function should be undefined', async ({
runner,
}) => {
Expand Down
Loading