Skip to content

Commit c960b78

Browse files
zncksxzz
authored andcommitted
test(compiler-core): add test for identifier collision
1 parent 16d38df commit c960b78

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/compiler-sfc/__tests__/rewriteDefault.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,18 @@ describe('compiler sfc: rewriteDefault', () => {
191191
export { bar, } from './index.js'
192192
const script = foo"
193193
`)
194+
195+
expect(
196+
compileRewriteDefault(
197+
`export { foo as default } from './index.js' \n const foo = 1`,
198+
'script'
199+
)
200+
).toMatchInlineSnapshot(`
201+
"import { foo } from './index.js'
202+
export { } from './index.js'
203+
const foo = 1
204+
const script = foo"
205+
`)
194206
})
195207

196208
test('export default class', async () => {

0 commit comments

Comments
 (0)