1
- const extend = require ( '../extendJSConfig' )
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 )
3
+ function extend ( value , source ) {
4
+ return _extend ( value , source ) . replace ( / \r \n / g, '\n' )
7
5
}
8
6
9
7
test ( `basic` , ( ) => {
@@ -20,7 +18,7 @@ test(`basic`, () => {
20
18
modules: false
21
19
}
22
20
}`
23
- assertMatch ( extend ( value , source ) ,
21
+ expect ( extend ( value , source ) ) . toMatch (
24
22
`module.exports = {
25
23
foo: true,
26
24
css: {
@@ -38,7 +36,7 @@ test(`adding new property`, () => {
38
36
`module.exports = {
39
37
bar: 123
40
38
}`
41
- assertMatch ( extend ( value , source ) ,
39
+ expect ( extend ( value , source ) ) . toMatch (
42
40
`module.exports = {
43
41
bar: 123,
44
42
foo: true
@@ -55,7 +53,7 @@ test(`non direct assignment`, () => {
55
53
bar: 123
56
54
}
57
55
module.exports = config`
58
- assertMatch ( extend ( value , source ) ,
56
+ expect ( extend ( value , source ) ) . toMatch (
59
57
`const config = {
60
58
bar: 123,
61
59
foo: true
0 commit comments