Skip to content

Commit

Permalink
chore: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhe141 committed Sep 24, 2024
1 parent 92d67cb commit 59db93e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/compiler-core/__tests__/transforms/vFor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,18 @@ describe('compiler: v-for', () => {
)
const keyExp =
// @ts-expect-error
codegenNode.children.arguments[1].body.body[1].children[2].children[0]
.content
expect(keyExp).toBe('_ctx.getId')
codegenNode.children.arguments[1].body.body[1].children[2]
expect(keyExp).toMatchObject({
type: NodeTypes.COMPOUND_EXPRESSION,
children: [
// should prefix outer scope references
{ content: `_ctx.getId` },
`(`,
// should NOT prefix in scope variables
{ content: `data` },
`)`,
],
})
})

test('template v-for key no prefixing on attribute key', () => {
Expand Down

0 comments on commit 59db93e

Please sign in to comment.