From 559fa27185e72a7687eed4d8ad5529002489a446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E9=93=84=E8=BF=90?= Date: Wed, 11 Dec 2019 22:26:14 +0800 Subject: [PATCH] test(compiler-sfc): more tests (#536) --- .../compileTemplate.spec.ts.snap | 27 ++++++++ .../__tests__/compileTemplate.spec.ts | 69 ++++++++++++++++++- packages/compiler-sfc/src/compileTemplate.ts | 17 +++-- 3 files changed, 107 insertions(+), 6 deletions(-) create mode 100644 packages/compiler-sfc/__tests__/__snapshots__/compileTemplate.spec.ts.snap diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileTemplate.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileTemplate.spec.ts.snap new file mode 100644 index 00000000..8cb28f25 --- /dev/null +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileTemplate.spec.ts.snap @@ -0,0 +1,27 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`source map 1`] = ` +Object { + "mappings": ";;;;UAAA,aACE;IAAK,gCAAMA,WAAM", + "names": Array [ + "render", + ], + "sources": Array [ + "example.vue", + ], + "sourcesContent": Array [ + " +

{{ render }}

+", + ], + "version": 3, +} +`; + +exports[`template errors 1`] = ` +Array [ + [SyntaxError: Invalid JavaScript expression. (2:13)], + [SyntaxError: v-bind is missing expression. (1:6)], + [SyntaxError: v-model can only be used on ,