Skip to content

Commit 492adbd

Browse files
committed
test: fix test case on windows
1 parent a0004ea commit 492adbd

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/@vue/cli/lib/util/__tests__/extendJSConfig.spec.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
const extend = require('../extendJSConfig')
1+
const _extend = require('../extendJSConfig')
22

3-
function assertMatch (source, expected) {
4-
source = source.split(/\n\r?/g)
5-
expected = expected.split(/\n\r?/g)
6-
expect(source).toEqual(expected)
3+
function extend (value, source) {
4+
return _extend(value, source).replace(/\r\n/g, '\n')
75
}
86

97
test(`basic`, () => {
@@ -20,7 +18,7 @@ test(`basic`, () => {
2018
modules: false
2119
}
2220
}`
23-
assertMatch(extend(value, source),
21+
expect(extend(value, source)).toMatch(
2422
`module.exports = {
2523
foo: true,
2624
css: {
@@ -38,7 +36,7 @@ test(`adding new property`, () => {
3836
`module.exports = {
3937
bar: 123
4038
}`
41-
assertMatch(extend(value, source),
39+
expect(extend(value, source)).toMatch(
4240
`module.exports = {
4341
bar: 123,
4442
foo: true
@@ -55,7 +53,7 @@ test(`non direct assignment`, () => {
5553
bar: 123
5654
}
5755
module.exports = config`
58-
assertMatch(extend(value, source),
56+
expect(extend(value, source)).toMatch(
5957
`const config = {
6058
bar: 123,
6159
foo: true

0 commit comments

Comments
 (0)