@@ -13,22 +13,20 @@ describe.runIf(isBuild)('build', () => {
13
13
const index = files . find ( ( f ) => f . includes ( 'main-module' ) )
14
14
const content = fs . readFileSync ( path . resolve ( assetsDir , index ) , 'utf-8' )
15
15
const indexSourcemap = getSourceMapUrl ( content )
16
- const worker = files . find ( ( f ) => / ^ m y - w o r k e r \. \w + \. j s $ / . test ( f ) )
16
+ const worker = files . find ( ( f ) => / ^ m y - w o r k e r - \w + \. j s $ / . test ( f ) )
17
17
const workerContent = fs . readFileSync (
18
18
path . resolve ( assetsDir , worker ) ,
19
19
'utf-8'
20
20
)
21
21
const workerSourcemap = getSourceMapUrl ( workerContent )
22
- const sharedWorker = files . find ( ( f ) =>
23
- / ^ m y - s h a r e d - w o r k e r \. \w + \. j s $ / . test ( f )
24
- )
22
+ const sharedWorker = files . find ( ( f ) => / ^ m y - s h a r e d - w o r k e r - \w + \. j s $ / . test ( f ) )
25
23
const sharedWorkerContent = fs . readFileSync (
26
24
path . resolve ( assetsDir , sharedWorker ) ,
27
25
'utf-8'
28
26
)
29
27
const sharedWorkerSourcemap = getSourceMapUrl ( sharedWorkerContent )
30
28
const possibleTsOutputWorker = files . find ( ( f ) =>
31
- / ^ p o s s i b l e - t s - o u t p u t - w o r k e r \. \w + \. j s $ / . test ( f )
29
+ / ^ p o s s i b l e - t s - o u t p u t - w o r k e r - \w + \. j s $ / . test ( f )
32
30
)
33
31
const possibleTsOutputWorkerContent = fs . readFileSync (
34
32
path . resolve ( assetsDir , possibleTsOutputWorker ) ,
@@ -38,7 +36,7 @@ describe.runIf(isBuild)('build', () => {
38
36
possibleTsOutputWorkerContent
39
37
)
40
38
const workerNestedWorker = files . find ( ( f ) =>
41
- / ^ w o r k e r - n e s t e d - w o r k e r \. \w + \. j s $ / . test ( f )
39
+ / ^ w o r k e r - n e s t e d - w o r k e r - \w + \. j s $ / . test ( f )
42
40
)
43
41
const workerNestedWorkerContent = fs . readFileSync (
44
42
path . resolve ( assetsDir , workerNestedWorker ) ,
@@ -47,41 +45,41 @@ describe.runIf(isBuild)('build', () => {
47
45
const workerNestedWorkerSourcemap = getSourceMapUrl (
48
46
workerNestedWorkerContent
49
47
)
50
- const subWorker = files . find ( ( f ) => / ^ s u b - w o r k e r \. \w + \. j s $ / . test ( f ) )
48
+ const subWorker = files . find ( ( f ) => / ^ s u b - w o r k e r - \w + \. j s $ / . test ( f ) )
51
49
const subWorkerContent = fs . readFileSync (
52
50
path . resolve ( assetsDir , subWorker ) ,
53
51
'utf-8'
54
52
)
55
53
const subWorkerSourcemap = getSourceMapUrl ( subWorkerContent )
56
54
57
- expect ( files ) . toContainEqual ( expect . stringMatching ( / ^ i n d e x \. \w + \. j s \. m a p $ / ) )
55
+ expect ( files ) . toContainEqual ( expect . stringMatching ( / ^ i n d e x - \w + \. j s \. m a p $ / ) )
58
56
expect ( files ) . toContainEqual (
59
- expect . stringMatching ( / ^ m y - w o r k e r \. \w + \. j s \. m a p $ / )
57
+ expect . stringMatching ( / ^ m y - w o r k e r - \w + \. j s \. m a p $ / )
60
58
)
61
59
expect ( files ) . toContainEqual (
62
- expect . stringMatching ( / ^ m y - s h a r e d - w o r k e r \. \w + \. j s \. m a p $ / )
60
+ expect . stringMatching ( / ^ m y - s h a r e d - w o r k e r - \w + \. j s \. m a p $ / )
63
61
)
64
62
expect ( files ) . toContainEqual (
65
- expect . stringMatching ( / ^ p o s s i b l e - t s - o u t p u t - w o r k e r \. \w + \. j s \. m a p $ / )
63
+ expect . stringMatching ( / ^ p o s s i b l e - t s - o u t p u t - w o r k e r - \w + \. j s \. m a p $ / )
66
64
)
67
65
expect ( files ) . toContainEqual (
68
- expect . stringMatching ( / ^ w o r k e r - n e s t e d - w o r k e r \. \w + \. j s \. m a p $ / )
66
+ expect . stringMatching ( / ^ w o r k e r - n e s t e d - w o r k e r - \w + \. j s \. m a p $ / )
69
67
)
70
68
expect ( files ) . toContainEqual (
71
- expect . stringMatching ( / ^ s u b - w o r k e r \. \w + \. j s \. m a p $ / )
69
+ expect . stringMatching ( / ^ s u b - w o r k e r - \w + \. j s \. m a p $ / )
72
70
)
73
71
74
72
// sourcemap should exist and have a data URL
75
- expect ( indexSourcemap ) . toMatch ( / ^ m a i n - m o d u l e \. \w + \. j s \. m a p $ / )
76
- expect ( workerSourcemap ) . toMatch ( / ^ m y - w o r k e r \. \w + \. j s \. m a p $ / )
77
- expect ( sharedWorkerSourcemap ) . toMatch ( / ^ m y - s h a r e d - w o r k e r \. \w + \. j s \. m a p $ / )
73
+ expect ( indexSourcemap ) . toMatch ( / ^ m a i n - m o d u l e - \w + \. j s \. m a p $ / )
74
+ expect ( workerSourcemap ) . toMatch ( / ^ m y - w o r k e r - \w + \. j s \. m a p $ / )
75
+ expect ( sharedWorkerSourcemap ) . toMatch ( / ^ m y - s h a r e d - w o r k e r - \w + \. j s \. m a p $ / )
78
76
expect ( possibleTsOutputWorkerSourcemap ) . toMatch (
79
- / ^ p o s s i b l e - t s - o u t p u t - w o r k e r \. \w + \. j s \. m a p $ /
77
+ / ^ p o s s i b l e - t s - o u t p u t - w o r k e r - \w + \. j s \. m a p $ /
80
78
)
81
79
expect ( workerNestedWorkerSourcemap ) . toMatch (
82
- / ^ w o r k e r - n e s t e d - w o r k e r \. \w + \. j s \. m a p $ /
80
+ / ^ w o r k e r - n e s t e d - w o r k e r - \w + \. j s \. m a p $ /
83
81
)
84
- expect ( subWorkerSourcemap ) . toMatch ( / ^ s u b - w o r k e r \. \w + \. j s \. m a p $ / )
82
+ expect ( subWorkerSourcemap ) . toMatch ( / ^ s u b - w o r k e r - \w + \. j s \. m a p $ / )
85
83
86
84
// worker should have all imports resolved and no exports
87
85
expect ( workerContent ) . not . toMatch ( `import` )
0 commit comments