tests: fix path match on Windows

This commit is contained in:
Haoqun Jiang
2018-12-26 15:33:14 +08:00
parent e3a58cb29e
commit 710807bd43

View File

@@ -32,7 +32,7 @@ test('polyfill detection', () => {
// promise polyfill alone doesn't work in IE, needs this as well. fix: #1642
expect(code).toMatch(`import "core-js/modules/es6.array.iterator"`)
// usage-based detection
expect(code).toMatch(/import _Map from ".*@babel\/runtime-corejs2\/core-js\/map"/)
expect(code).toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
})
test('modern mode always skips polyfills', () => {
@@ -49,7 +49,7 @@ test('modern mode always skips polyfills', () => {
// default includes
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
// usage-based detection
expect(code).not.toMatch(/import _Map from ".*@babel\/runtime-corejs2\/core-js\/map"/)
expect(code).not.toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
;({ code } = babel.transformSync(`
const a = new Map()
@@ -63,7 +63,7 @@ test('modern mode always skips polyfills', () => {
// default includes
expect(code).not.toMatch(`import "core-js/modules/es6.promise"`)
// usage-based detection
expect(code).not.toMatch(/import _Map from ".*@babel\/runtime-corejs2\/core-js\/map"/)
expect(code).not.toMatch(/import _Map from ".*runtime-corejs2\/core-js\/map"/)
delete process.env.VUE_CLI_MODERN_BUILD
})
@@ -92,7 +92,7 @@ test('async/await', () => {
// should use regenerator runtime
expect(code).toMatch(`import "regenerator-runtime/runtime"`)
// should use required helper instead of inline
expect(code).toMatch(/import _asyncToGenerator from ".*@babel\/runtime-corejs2\/helpers\/esm\/asyncToGenerator\"/)
expect(code).toMatch(/import _asyncToGenerator from ".*runtime-corejs2\/helpers\/esm\/asyncToGenerator\"/)
})
test('jsx', () => {