From 16ca64e19f12721959c6c8ba6b996d209b82ce8c Mon Sep 17 00:00:00 2001
From: Jaw <53564781+jaw52@users.noreply.github.com>
Date: Wed, 2 Aug 2023 00:34:10 +0800
Subject: [PATCH] fix: lines break (#156)
---
src/core/transform.ts | 2 +-
test/transform_filter.test.ts | 75 +++++++++++++++++++++++++++++++++++
2 files changed, 76 insertions(+), 1 deletion(-)
create mode 100644 test/transform_filter.test.ts
diff --git a/src/core/transform.ts b/src/core/transform.ts
index ad3ad31..06853c5 100644
--- a/src/core/transform.ts
+++ b/src/core/transform.ts
@@ -6,7 +6,7 @@ import { transformScriptSetup } from './transformScriptSetup'
import { transformSfcRefSugar } from './transformSfcRefSugar'
import { resolveOptions } from './options'
-const scriptSetupRE = /`,
+ ``,
+ ``,
+ `
+ `,
+ `
+ `,
+ `
+ `,
+ ``,
+ ]
+
+ for (const input of cases) {
+ it(input, () => {
+ expect(scriptSetupRE.test(input)).toEqual(true)
+ })
+ }
+ })
+
+ describe('filter what is not needed by regular ', () => {
+ const cases: string[] = [
+ `
+ import HelloWorld from './HelloWorld.vue'
+
+ `,
+ ``,
+ `
+ `,
+ ]
+
+ for (const input of cases) {
+ it(input, () => {
+ expect(scriptSetupRE.test(input)).toEqual(false)
+ })
+ }
+ })
+})