diff --git a/workspaces/libnpmversion/tap-snapshots/test/write-json.js.test.cjs b/workspaces/libnpmversion/tap-snapshots/test/write-json.js.test.cjs deleted file mode 100644 index 14397b2bfd350..0000000000000 --- a/workspaces/libnpmversion/tap-snapshots/test/write-json.js.test.cjs +++ /dev/null @@ -1,39 +0,0 @@ -/* IMPORTANT - * This snapshot file is auto-generated, but designed for humans. - * It should be checked into source control and tracked carefully. - * Re-generate by setting TAP_SNAPSHOT=1 and running tests. - * Make sure to inspect the output below. Do not ignore changes! - */ -'use strict' -exports[`test/write-json.js TAP write json with newlines and indent set default newline and indent > expect resolving Promise 1`] = ` -{ - "a": 1, - "b": [ - 2, - 3 - ] -} - -` - -exports[`test/write-json.js TAP write json with newlines and indent set numeric three space indent, CRLF line breaks > expect resolving Promise 1`] = ` -{ - "a": 1, - "b": [ - 2, - 3 - ] -} - -` - -exports[`test/write-json.js TAP write json with newlines and indent set string tap indent, CRLF line breaks > expect resolving Promise 1`] = ` -{XYZ - "a": 1,XYZ - "b": [XYZ - 2,XYZ - 3XYZ - ]XYZ -}XYZ - -` diff --git a/workspaces/libnpmversion/test/write-json.js b/workspaces/libnpmversion/test/write-json.js index 38b6630cdfc95..63dccf6cf5d0e 100644 --- a/workspaces/libnpmversion/test/write-json.js +++ b/workspaces/libnpmversion/test/write-json.js @@ -18,7 +18,8 @@ t.test('write json with newlines and indent set', async t => { b: [2, 3], }) - await t.resolveMatchSnapshot(readFile(file, 'utf-8')) + const str = await readFile(file, 'utf-8') + t.equal(str, `{\r\n "a": 1,\r\n "b": [\r\n 2,\r\n 3\r\n ]\r\n}\r\n`) }) 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 => { b: [2, 3], }) - await t.resolveMatchSnapshot(readFile(file, 'utf-8')) + const str = await readFile(file, 'utf-8') + 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`) }) t.test('default newline and indent', async t => { @@ -44,7 +46,8 @@ t.test('write json with newlines and indent set', async t => { b: [2, 3], }) - await t.resolveMatchSnapshot(readFile(file, 'utf-8')) + const str = await readFile(file, 'utf-8') + t.match(str, `{\n "a": 1,\n "b": [\n 2,\n 3\n ]\n}\n`) }) t.end()