@@ -18,7 +18,8 @@ t.test('write json with newlines and indent set', async t => {
18
18
b : [ 2 , 3 ] ,
19
19
} )
20
20
21
- await t . resolveMatchSnapshot ( readFile ( file , 'utf-8' ) )
21
+ const str = await readFile ( file , 'utf-8' )
22
+ t . equal ( str , `{\r\n "a": 1,\r\n "b": [\r\n 2,\r\n 3\r\n ]\r\n}\r\n` )
22
23
} )
23
24
24
25
t . test ( 'string tap indent, CRLF line breaks' , async t => {
@@ -32,7 +33,8 @@ t.test('write json with newlines and indent set', async t => {
32
33
b : [ 2 , 3 ] ,
33
34
} )
34
35
35
- await t . resolveMatchSnapshot ( readFile ( file , 'utf-8' ) )
36
+ const str = await readFile ( file , 'utf-8' )
37
+ t . equal ( str , `{XYZ\n\t"a": 1,XYZ\n\t"b": [XYZ\n\t\t2,XYZ\n\t\t3XYZ\n\t]XYZ\n}XYZ\n` )
36
38
} )
37
39
38
40
t . test ( 'default newline and indent' , async t => {
@@ -44,7 +46,8 @@ t.test('write json with newlines and indent set', async t => {
44
46
b : [ 2 , 3 ] ,
45
47
} )
46
48
47
- await t . resolveMatchSnapshot ( readFile ( file , 'utf-8' ) )
49
+ const str = await readFile ( file , 'utf-8' )
50
+ t . match ( str , `{\n "a": 1,\n "b": [\n 2,\n 3\n ]\n}\n` )
48
51
} )
49
52
50
53
t . end ( )
0 commit comments