Skip to content

Commit 4753f60

Browse files
committed
chore: update some tests that relies on rollup's behavior
1 parent 68e6581 commit 4753f60

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

playground/worker/__tests__/es/worker-es.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describe.runIf(isBuild)('build', () => {
105105

106106
// worker should have all imports resolved and no exports
107107
expect(workerContent).not.toMatch(/import[^.]/)
108-
expect(workerContent).not.toMatch(`export`)
108+
expect(workerContent).not.toMatch(/\bexport\b/)
109109
// chunk
110110
expect(content).toMatch(`new Worker("/es/assets`)
111111
expect(content).toMatch(`new SharedWorker("/es/assets`)

playground/worker/__tests__/iife/worker-iife.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe.runIf(isBuild)('build', () => {
9292

9393
// worker should have all imports resolved and no exports
9494
expect(workerContent).not.toMatch(`import`)
95-
expect(workerContent).not.toMatch(`export`)
95+
expect(workerContent).not.toMatch(/\bexport\b/)
9696
// chunk
9797
expect(content).toMatch(`new Worker("/iife/assets`)
9898
expect(content).toMatch(`new SharedWorker("/iife/assets`)
@@ -191,7 +191,7 @@ test.runIf(isServe)('sourcemap is correct after env is injected', async () => {
191191
const content = await (await response).text()
192192
const { mappings } = decodeSourceMapUrl(content)
193193
expect(mappings).toMatchInlineSnapshot(
194-
`";;AAAA,SAAS,OAAO,kBAAkB,8BAA8B;AAChE,SAAS,MAAM,WAAW,2BAA2B;AACrD,SAAS,wBAAwB,uBAAuB;AACxD,OAAO,aAAa,YAAY;AAChC,MAAM,UAAU,OAAO,KAAK;AAE5B,KAAK,YAAY,CAAC,MAAM;AACtB,KAAI,EAAE,SAAS,QAAQ;AACrB,OAAK,YAAY;GAAE;GAAK;GAAM;GAAkB;GAAS;GAAS;EAAM,EAAC;CAC1E;AACD,KAAI,EAAE,SAAS,gBAAgB;AAC7B,OAAK,YAAY;GACf,KAAK;GACL;GACA;GACA;GACA;GACA;EACD,EAAC;CACH;AACF;AACD,KAAK,YAAY;CACf;CACA;CACA;CACA;CACA;CACA;CACA;AACD,EAAC;AAGF,QAAQ,IAAI,eAAe"`,
194+
`";;AAAA,SAAS,OAAO,kBAAkB,8BAA8B;AAChE,OAAO,YAAY,6BAA6B;AAChD,SAAS,MAAM,WAAW,2BAA2B;AACrD,SAAS,wBAAwB,uBAAuB;AACxD,OAAO,aAAa,YAAY;AAChC,MAAM,UAAU,OAAO,KAAK;AAE5B,KAAK,YAAY,CAAC,MAAM;AACtB,KAAI,EAAE,SAAS,QAAQ;AACrB,OAAK,YAAY;GACf;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC;CACH;AACD,KAAI,EAAE,SAAS,gBAAgB;AAC7B,OAAK,YAAY;GACf,KAAK;GACL;GACA;GACA;GACA;GACA;GACA;EACD,EAAC;CACH;AACF;AACD,KAAK,YAAY;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,EAAC;AAGF,QAAQ,IAAI,eAAe"`,
195195
)
196196
})
197197

playground/worker/__tests__/relative-base/worker-relative-base.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe.runIf(isBuild)('build', () => {
7676

7777
// worker should have all imports resolved and no exports
7878
expect(workerContent).not.toMatch(/import(?!\.)/) // accept import.meta.url
79-
expect(workerContent).not.toMatch(`export`)
79+
expect(workerContent).not.toMatch(/\bexport\b/)
8080
// chunk
8181
expect(content).toMatch(`new Worker(""+new URL("../worker-entries/`)
8282
expect(content).toMatch(`new SharedWorker(""+new URL("../worker-entries/`)

playground/worker/__tests__/sourcemap-hidden/worker-sourcemap-hidden.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe.runIf(isBuild)('build', () => {
8484

8585
// worker should have all imports resolved and no exports
8686
expect(workerContent).not.toMatch(`import`)
87-
expect(workerContent).not.toMatch(`export`)
87+
expect(workerContent).not.toMatch(/\bexport\b/)
8888

8989
// shared worker should have all imports resolved and no exports
9090
expect(sharedWorkerContent).not.toMatch(`import`)

playground/worker/__tests__/sourcemap-inline/worker-sourcemap-inline.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe.runIf(isBuild)('build', () => {
6565

6666
// worker should have all imports resolved and no exports
6767
expect(workerContent).not.toMatch(`import`)
68-
expect(workerContent).not.toMatch(`export`)
68+
expect(workerContent).not.toMatch(/\bexport\b/)
6969

7070
// shared worker should have all imports resolved and no exports
7171
expect(sharedWorkerContent).not.toMatch(`import`)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe.runIf(isBuild)('build', () => {
8787

8888
// worker should have all imports resolved and no exports
8989
expect(workerContent).not.toMatch(`import`)
90-
expect(workerContent).not.toMatch(`export`)
90+
expect(workerContent).not.toMatch(/\bexport\b/)
9191

9292
// shared worker should have all imports resolved and no exports
9393
expect(sharedWorkerContent).not.toMatch(`import`)

0 commit comments

Comments
 (0)