test(compiler): fix copy paste in v-once spec (#191)

This commit is contained in:
Cédric Exbrayat 2019-10-10 19:54:22 +02:00 committed by Evan You
parent cbb4b19cfb
commit 4ca32c537d

View File

@ -3,7 +3,7 @@ import { transformOnce } from '../../src/transforms/vOnce'
import { transformElement } from '../../src/transforms/transformElement' import { transformElement } from '../../src/transforms/transformElement'
import { createObjectMatcher } from '../testUtils' import { createObjectMatcher } from '../testUtils'
function transformWithCloak(template: string) { function transformWithOnce(template: string) {
const ast = parse(template) const ast = parse(template)
transform(ast, { transform(ast, {
nodeTransforms: [transformElement], nodeTransforms: [transformElement],
@ -16,10 +16,10 @@ function transformWithCloak(template: string) {
describe('compiler: v-once transform', () => { describe('compiler: v-once transform', () => {
test('should add no props to DOM', () => { test('should add no props to DOM', () => {
const node = transformWithCloak(`<div v-once />`) const node = transformWithOnce(`<div v-once />`)
const codegenArgs = (node.codegenNode as CallExpression).arguments const codegenArgs = (node.codegenNode as CallExpression).arguments
// As v-cloak adds no properties the codegen should be identical to // As v-once adds no properties the codegen should be identical to
// rendering a div with no props or reactive data (so just the tag as the arg) // rendering a div with no props or reactive data (so just the tag as the arg)
expect(codegenArgs[1]).toMatchObject( expect(codegenArgs[1]).toMatchObject(
createObjectMatcher({ createObjectMatcher({