From 8dea0dddbf0ff7db1a6823a12a21d42eaa13cd40 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 13 May 2022 10:25:13 +0800 Subject: [PATCH] test: merge tests --- .../compileScriptPropsTransform.spec.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/packages/compiler-sfc/__tests__/compileScriptPropsTransform.spec.ts b/packages/compiler-sfc/__tests__/compileScriptPropsTransform.spec.ts index 95f7da51196..b42bb63a4ee 100644 --- a/packages/compiler-sfc/__tests__/compileScriptPropsTransform.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScriptPropsTransform.spec.ts @@ -127,7 +127,8 @@ describe('sfc props transform', () => { }) }) - test('aliasing w/ StringLiteral', () => { + // #5425 + test('non-identifier prop names', () => { const { content, bindings } = compile(` `) + expect(content).toMatch(`x = (__props["foo.bar"])`) + expect(content).toMatch(`toDisplayString(__props["foo.bar"])`) assertCode(content) expect(bindings).toStrictEqual({ x: BindingTypes.SETUP_LET, @@ -181,20 +184,6 @@ describe('sfc props transform', () => { assertCode(content) }) - // #5425 - test('non-identifier prop names', () => { - const { content } = compile(` - - - `) - expect(content).toMatch(`console.log(__props["onUpdate:foo"])`) - expect(content).toMatch(`toDisplayString(__props["onUpdate:foo"])`) - assertCode(content) - }) - describe('errors', () => { test('should error on deep destructure', () => { expect(() =>