Skip to content

Commit 67b9431

Browse files
committed
fixup! fix: prefer fs/promises over promisify
1 parent dc72373 commit 67b9431

File tree

2 files changed

+6
-42
lines changed

2 files changed

+6
-42
lines changed

workspaces/libnpmversion/tap-snapshots/test/write-json.js.test.cjs

Lines changed: 0 additions & 39 deletions
This file was deleted.

workspaces/libnpmversion/test/write-json.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ t.test('write json with newlines and indent set', async t => {
1818
b: [2, 3],
1919
})
2020

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`)
2223
})
2324

2425
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 => {
3233
b: [2, 3],
3334
})
3435

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`)
3638
})
3739

3840
t.test('default newline and indent', async t => {
@@ -44,7 +46,8 @@ t.test('write json with newlines and indent set', async t => {
4446
b: [2, 3],
4547
})
4648

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`)
4851
})
4952

5053
t.end()

0 commit comments

Comments
 (0)