@@ -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 ( genCoreJSImportRegExp ( 'es6.array.iterator' ) )
47
47
// usage-based detection
48
- expect ( code ) . toMatch ( / i m p o r t " c o r e - j s \/ m o d u l e s \/ e s 6 . m a p " / )
48
+ expect ( code ) . toMatch ( / i m p o r t _ M a p f r o m " . * r u n t i m e - c o r e j s 2 \/ c o r e - j s \/ m a p " / )
49
49
} )
50
50
51
51
test ( 'modern mode always skips polyfills' , ( ) => {
@@ -63,7 +63,7 @@ test('modern mode always skips polyfills', () => {
63
63
// default includes
64
64
expect ( code ) . not . toMatch ( genCoreJSImportRegExp ( 'es6.promise' ) )
65
65
// usage-based detection
66
- expect ( code ) . not . toMatch ( / i m p o r t " c o r e - j s \/ m o d u l e s \/ e s 6 . m a p " / )
66
+ expect ( code ) . not . toMatch ( / i m p o r t _ M a p f r o m " . * r u n t i m e - c o r e j s 2 \/ c o r e - j s \/ m a p " / )
67
67
68
68
; ( { code } = babel . transformSync ( `
69
69
const a = new Map()
@@ -78,7 +78,7 @@ test('modern mode always skips polyfills', () => {
78
78
// default includes
79
79
expect ( code ) . not . toMatch ( genCoreJSImportRegExp ( 'es6.promise' ) )
80
80
// usage-based detection
81
- expect ( code ) . not . toMatch ( / i m p o r t " c o r e - j s \/ m o d u l e s \/ e s 6 . m a p " / )
81
+ expect ( code ) . not . toMatch ( / i m p o r t _ M a p f r o m " . * r u n t i m e - c o r e j s 2 \/ c o r e - j s \/ m a p " / )
82
82
delete process . env . VUE_CLI_MODERN_BUILD
83
83
} )
84
84
@@ -107,7 +107,7 @@ test('async/await', () => {
107
107
// should use regenerator runtime
108
108
expect ( code ) . toMatch ( `import "regenerator-runtime/runtime"` )
109
109
// should use required helper instead of inline
110
- expect ( code ) . toMatch ( / i m p o r t _ a s y n c T o G e n e r a t o r f r o m " .* r u n t i m e \/ h e l p e r s \/ e s m \/ a s y n c T o G e n e r a t o r \" / )
110
+ expect ( code ) . toMatch ( / i m p o r t _ a s y n c T o G e n e r a t o r f r o m " .* r u n t i m e - c o r e j s 2 \/ h e l p e r s \/ e s m \/ a s y n c T o G e n e r a t o r \" / )
111
111
} )
112
112
113
113
test ( 'jsx' , ( ) => {
@@ -152,6 +152,6 @@ test('disable absoluteRuntime', () => {
152
152
filename : 'test-entry-file.js'
153
153
} )
154
154
155
- expect ( code ) . toMatch ( 'import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"' )
156
- expect ( code ) . not . toMatch ( genCoreJSImportRegExp ( 'es6.promise' ) )
155
+ expect ( code ) . toMatch ( 'import _toConsumableArray from "@babel/runtime-corejs2 /helpers/esm/toConsumableArray"' )
156
+ // expect(code).not.toMatch(genCoreJSImportRegExp('es6.promise'))
157
157
} )
0 commit comments