From 5518306b8569efc40e265905bd341942faadb9a5 Mon Sep 17 00:00:00 2001 From: yoho Date: Sat, 21 May 2022 22:03:30 +0800 Subject: [PATCH] fix: snapshots --- .../__snapshots__/serve.spec.ts.snap | 25 +++++++++++++++++++ .../vue-sourcemap/__tests__/serve.spec.ts | 24 +----------------- 2 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 playground/vue-sourcemap/__tests__/__snapshots__/serve.spec.ts.snap diff --git a/playground/vue-sourcemap/__tests__/__snapshots__/serve.spec.ts.snap b/playground/vue-sourcemap/__tests__/__snapshots__/serve.spec.ts.snap new file mode 100644 index 00000000000000..8daeb18dbf1028 --- /dev/null +++ b/playground/vue-sourcemap/__tests__/__snapshots__/serve.spec.ts.snap @@ -0,0 +1,25 @@ +// Vitest Snapshot v1 + +exports[`serve:vue-sourcemap > js 1`] = ` +{ + "mappings": "mIAKA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;AAGP;AACd,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;wBARlB,oBAAiB,WAAd,MAAU", + "sources": [ + "/root/Js.vue", + ], + "sourcesContent": [ + " + + + + +", + ], + "version": 3, +} +`; diff --git a/playground/vue-sourcemap/__tests__/serve.spec.ts b/playground/vue-sourcemap/__tests__/serve.spec.ts index 83e63c56f85a7a..cc3c9835fa31b3 100644 --- a/playground/vue-sourcemap/__tests__/serve.spec.ts +++ b/playground/vue-sourcemap/__tests__/serve.spec.ts @@ -22,29 +22,7 @@ describe.runIf(isServe)('serve:vue-sourcemap', () => { const res = await page.request.get(new URL('./Js.vue', page.url()).href) const js = await res.text() const map = extractSourcemap(js) - expect(formatSourcemapForSnapshot(map)).toMatchInlineSnapshot(` - { - "mappings": "AAKA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;AAGP;AACd,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;wBARlB,oBAAiB,WAAd,MAAU", - "sources": [ - "/root/Js.vue", - ], - "sourcesContent": [ - " - - - - - ", - ], - "version": 3, - } - `) + expect(formatSourcemapForSnapshot(map)).toMatchSnapshot() }) test('ts', async () => {