diff --git a/packages/compiler-core/__tests__/transforms/vBind.spec.ts b/packages/compiler-core/__tests__/transforms/vBind.spec.ts index 0f6a1a1a..460a7632 100644 --- a/packages/compiler-core/__tests__/transforms/vBind.spec.ts +++ b/packages/compiler-core/__tests__/transforms/vBind.spec.ts @@ -4,7 +4,8 @@ import { ElementNode, ObjectExpression, CompilerOptions, - ErrorCodes + ErrorCodes, + CallExpression } from '../../src' import { transformBind } from '../../src/transforms/vBind' import { transformElement } from '../../src/transforms/transformElement' @@ -32,7 +33,8 @@ function parseWithVBind( describe('compiler: transform v-bind', () => { test('basic', () => { const node = parseWithVBind(`
`) - const props = node.codegenNode!.arguments[1] as ObjectExpression + const props = (node.codegenNode as CallExpression) + .arguments[1] as ObjectExpression expect(props.properties[0]).toMatchObject({ key: { content: `id`, @@ -67,7 +69,8 @@ describe('compiler: transform v-bind', () => { test('dynamic arg', () => { const node = parseWithVBind(`
`) - const props = node.codegenNode!.arguments[1] as ObjectExpression + const props = (node.codegenNode as CallExpression) + .arguments[1] as ObjectExpression expect(props.properties[0]).toMatchObject({ key: { content: `id`, @@ -100,7 +103,8 @@ describe('compiler: transform v-bind', () => { test('.camel modifier', () => { const node = parseWithVBind(`
`) - const props = node.codegenNode!.arguments[1] as ObjectExpression + const props = (node.codegenNode as CallExpression) + .arguments[1] as ObjectExpression expect(props.properties[0]).toMatchObject({ key: { content: `fooBar`, @@ -115,7 +119,8 @@ describe('compiler: transform v-bind', () => { test('.camel modifier w/ dynamic arg', () => { const node = parseWithVBind(`
`) - const props = node.codegenNode!.arguments[1] as ObjectExpression + const props = (node.codegenNode as CallExpression) + .arguments[1] as ObjectExpression expect(props.properties[0]).toMatchObject({ key: { content: `_${CAMELIZE}(foo)`, @@ -132,7 +137,8 @@ describe('compiler: transform v-bind', () => { const node = parseWithVBind(`
`, { prefixIdentifiers: true }) - const props = node.codegenNode!.arguments[1] as ObjectExpression + const props = (node.codegenNode as CallExpression) + .arguments[1] as ObjectExpression expect(props.properties[0]).toMatchObject({ key: { children: [