File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
packages/@vue/cli/lib/util/__tests__ Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
const extend = require ( '../extendJSConfig' )
2
2
3
+ function assertMatch ( source , expected ) {
4
+ source = source . split ( / \n \r ? / g)
5
+ expected = expected . split ( / \n \r ? / g)
6
+ expect ( source ) . toEqual ( expected )
7
+ }
8
+
3
9
test ( `basic` , ( ) => {
4
10
const value = {
5
11
foo : true ,
@@ -14,7 +20,7 @@ test(`basic`, () => {
14
20
modules: false
15
21
}
16
22
}`
17
- expect ( extend ( value , source ) ) . toMatch (
23
+ assertMatch ( extend ( value , source ) ,
18
24
`module.exports = {
19
25
foo: true,
20
26
css: {
@@ -32,7 +38,7 @@ test(`adding new property`, () => {
32
38
`module.exports = {
33
39
bar: 123
34
40
}`
35
- expect ( extend ( value , source ) ) . toMatch (
41
+ assertMatch ( extend ( value , source ) ,
36
42
`module.exports = {
37
43
bar: 123,
38
44
foo: true
@@ -49,7 +55,7 @@ test(`non direct assignment`, () => {
49
55
bar: 123
50
56
}
51
57
module.exports = config`
52
- expect ( extend ( value , source ) ) . toMatch (
58
+ assertMatch ( extend ( value , source ) ,
53
59
`const config = {
54
60
bar: 123,
55
61
foo: true
You can’t perform that action at this time.
0 commit comments