Skip to content

Commit 710807b

Browse files
committed
tests: fix path match on Windows
1 parent e3a58cb commit 710807b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test('polyfill detection', () => {
3232
// promise polyfill alone doesn't work in IE, needs this as well. fix: #1642
3333
expect(code).toMatch(`import "core-js/modules/es6.array.iterator"`)
3434
// usage-based detection
35-
expect(code).toMatch(/import _Map from ".*@babel\/runtime-corejs2\/core-js\/map"/)
35+
expect(code).toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
3636
})
3737

3838
test('modern mode always skips polyfills', () => {
@@ -49,7 +49,7 @@ test('modern mode always skips polyfills', () => {
4949
// default includes
5050
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
5151
// usage-based detection
52-
expect(code).not.toMatch(/import _Map from ".*@babel\/runtime-corejs2\/core-js\/map"/)
52+
expect(code).not.toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
5353

5454
;({ code } = babel.transformSync(`
5555
const a = new Map()
@@ -63,7 +63,7 @@ test('modern mode always skips polyfills', () => {
6363
// default includes
6464
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
6565
// usage-based detection
66-
expect(code).not.toMatch(/import _Map from ".*@babel\/runtime-corejs2\/core-js\/map"/)
66+
expect(code).not.toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
6767
delete process.env.VUE_CLI_MODERN_BUILD
6868
})
6969

@@ -92,7 +92,7 @@ test('async/await', () => {
9292
// should use regenerator runtime
9393
expect(code).toMatch(`import "regenerator-runtime/runtime"`)
9494
// should use required helper instead of inline
95-
expect(code).toMatch(/import _asyncToGenerator from ".*@babel\/runtime-corejs2\/helpers\/esm\/asyncToGenerator\"/)
95+
expect(code).toMatch(/import _asyncToGenerator from ".*runtime-corejs2\/helpers\/esm\/asyncToGenerator\"/)
9696
})
9797

9898
test('jsx', () => {

0 commit comments

Comments
 (0)