Skip to content

Commit 28c8795

Browse files
committed
test(compiler-core): add test for identifier collision
1 parent 001184e commit 28c8795

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
@@ -149,6 +149,18 @@ describe('compiler sfc: rewriteDefault', () => {
149149
export { bar, } from './index.js'
150150
const script = foo"
151151
`)
152+
153+
expect(
154+
rewriteDefault(
155+
`export { foo as default } from './index.js' \n const foo = 1`,
156+
'script'
157+
)
158+
).toMatchInlineSnapshot(`
159+
"import { foo } from './index.js'
160+
export { } from './index.js'
161+
const foo = 1
162+
const script = foo"
163+
`)
152164
})
153165

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

0 commit comments

Comments
 (0)