Skip to content

Commit 2a038cc

Browse files
authored
test: normalize debugId in snapshot (#19475)
1 parent c575b82 commit 2a038cc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

playground/js-sourcemap/__tests__/js-sourcemap.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ describe.runIf(isBuild)('build tests', () => {
141141
const map = findAssetFile(/after-preload-dynamic-[-\w]{8}\.js\.map/)
142142
expect(formatSourcemapForSnapshot(JSON.parse(map))).toMatchInlineSnapshot(`
143143
{
144-
"debugId": "b4f4ae40-1415-414c-8350-c7286c81a413",
144+
"debugId": "00000000-0000-0000-0000-000000000000",
145145
"ignoreList": [],
146146
"mappings": ";+8BAAA,OAAO,2BAAuB,0BAE9B,QAAQ,IAAI,uBAAuB",
147147
"sources": [
@@ -180,7 +180,7 @@ describe.runIf(isBuild)('build tests', () => {
180180
const map = findAssetFile(/with-define-object.*\.js\.map/)
181181
expect(formatSourcemapForSnapshot(JSON.parse(map))).toMatchInlineSnapshot(`
182182
{
183-
"debugId": "bd3962fc-edb5-4a6d-a5da-f27a1e5f3268",
183+
"debugId": "00000000-0000-0000-0000-000000000000",
184184
"mappings": "qBAEA,SAASA,GAAO,CACJC,EAAA,CACZ,CAEA,SAASA,GAAY,CAEX,QAAA,MAAM,qBAAsBC,CAAkB,CACxD,CAEAF,EAAK",
185185
"sources": [
186186
"../../with-define-object.ts",

playground/test-utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ export const formatSourcemapForSnapshot = (map: any): any => {
370370
const m = { ...map }
371371
delete m.file
372372
delete m.names
373+
if (m.debugId) {
374+
m.debugId = '00000000-0000-0000-0000-000000000000'
375+
}
373376
m.sources = m.sources.map((source) => source.replace(root, '/root'))
374377
if (m.sourceRoot) {
375378
m.sourceRoot = m.sourceRoot.replace(root, '/root')

0 commit comments

Comments
 (0)