@@ -29,7 +29,7 @@ test('polyfill detection', () => {
29
29
// default includes
30
30
expect ( code ) . not . toMatch ( getAbsolutePolyfill ( 'es.promise' ) )
31
31
// usage-based detection
32
- expect ( code ) . not . toMatch ( '" core-js/modules/es.map" ' )
32
+ expect ( code ) . not . toMatch ( 'core-js/modules/es.map' )
33
33
34
34
; ( { code } = babel . transformSync ( `
35
35
const a = new Map()
@@ -45,7 +45,7 @@ test('polyfill detection', () => {
45
45
// promise polyfill alone doesn't work in IE, needs this as well. fix: #1642
46
46
expect ( code ) . toMatch ( getAbsolutePolyfill ( 'es.array.iterator' ) )
47
47
// usage-based detection
48
- expect ( code ) . toMatch ( '" core-js/modules/es.map" ' )
48
+ expect ( code ) . toMatch ( 'core-js/modules/es.map' )
49
49
} )
50
50
51
51
test ( 'modern mode always skips unnecessary polyfills' , ( ) => {
@@ -67,7 +67,7 @@ test('modern mode always skips unnecessary polyfills', () => {
67
67
// (modern: safari >= 10.1, es.promise: safrai >= 11)
68
68
// the custom configuration only expects to support safari >= 12
69
69
// so it can be skipped
70
- expect ( code ) . not . toMatch ( 'es.promise" ' )
70
+ expect ( code ) . not . toMatch ( 'es.promise[^.] ' )
71
71
// es.promise.finally is supported in safari >= 13.0.3
72
72
// so still needs to be included
73
73
expect ( code ) . toMatch ( 'es.promise.finally' )
@@ -89,10 +89,10 @@ test('modern mode always skips unnecessary polyfills', () => {
89
89
filename : 'test-entry-file.js'
90
90
} ) )
91
91
// default includes
92
- expect ( code ) . not . toMatch ( 'es.promise" ' )
92
+ expect ( code ) . not . toMatch ( 'es.promise[^.] ' )
93
93
expect ( code ) . not . toMatch ( 'es.promise.finally' )
94
94
// usage-based detection
95
- expect ( code ) . not . toMatch ( '" core-js/modules/es.map" ' )
95
+ expect ( code ) . not . toMatch ( 'core-js/modules/es.map' )
96
96
expect ( code ) . not . toMatch ( 'es.global-this' )
97
97
delete process . env . VUE_CLI_MODERN_BUILD
98
98
} )
@@ -120,7 +120,7 @@ test('async/await', () => {
120
120
` . trim ( ) , defaultOptions )
121
121
expect ( code ) . toMatch ( getAbsolutePolyfill ( 'es.promise' ) )
122
122
// should use regenerator runtime
123
- expect ( code ) . toMatch ( `" regenerator-runtime/runtime" ` )
123
+ expect ( code ) . toMatch ( `regenerator-runtime/runtime` )
124
124
} )
125
125
126
126
test ( 'jsx' , ( ) => {
@@ -166,7 +166,7 @@ test('disable absoluteRuntime', () => {
166
166
filename : 'test-entry-file.js'
167
167
} )
168
168
169
- expect ( code ) . toMatch ( '" @babel/runtime/helpers/toConsumableArray" ' )
169
+ expect ( code ) . toMatch ( '@babel/runtime/helpers/toConsumableArray' )
170
170
expect ( code ) . not . toMatch ( getAbsolutePolyfill ( 'es.promise' ) )
171
171
} )
172
172
@@ -187,8 +187,8 @@ test('should inject polyfills / helpers using "require" statements for a umd mod
187
187
} ] ] ,
188
188
filename : 'test-entry-file.js'
189
189
} )
190
- expect ( code ) . toMatch ( 'require("@babel/runtime/helpers/toConsumableArray") ' )
191
- expect ( code ) . toMatch ( 'require("core-js/modules/es.promise") ' )
190
+ expect ( code ) . toMatch ( 'require("@babel/runtime/helpers/toConsumableArray' )
191
+ expect ( code ) . toMatch ( 'require("core-js/modules/es.promise' )
192
192
expect ( code ) . not . toMatch ( 'import ' )
193
193
} )
194
194
@@ -205,8 +205,8 @@ test('should inject polyfills / helpers using "import" statements for an es modu
205
205
filename : 'test-entry-file.js'
206
206
} )
207
207
208
- expect ( code ) . toMatch ( 'import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray" ' )
209
- expect ( code ) . toMatch ( 'import "core-js/modules/es.promise" ' )
208
+ expect ( code ) . toMatch ( 'import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray' )
209
+ expect ( code ) . toMatch ( 'import "core-js/modules/es.promise' )
210
210
expect ( code ) . not . toMatch ( 'require(' )
211
211
} )
212
212
0 commit comments