Skip to content

Commit

Permalink
BREAKING(testing/snapshot): change tab char serialization (#3447)
Browse files Browse the repository at this point in the history
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
  • Loading branch information
wafuwafu13 and kt3k authored Jul 29, 2023
1 parent 5b480e3 commit 428154a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions testing/__snapshots__/snapshot_test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ snapshot[`Snapshot Test - step 2`] = `"hello world"`;

snapshot[`Snapshot Test - Adverse String \\ \` \${} 1`] = `"\\\\ \` \${}"`;

snapshot[`Snapshot Test - Default serializer 1`] = `
"a
b c"
`;

snapshot[`Snapshot Test - Multi-Line Strings > string 1`] = `
"
" +
Expand Down
3 changes: 2 additions & 1 deletion testing/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ export function serialize(actual: unknown): string {
compact: false,
iterableLimit: Infinity,
strAbbreviateSize: Infinity,
}).replace(/\\n/g, "\n");
escapeSequences: false,
});
}

/**
Expand Down
4 changes: 4 additions & 0 deletions testing/snapshot_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ Deno.test("Snapshot Test - Adverse String \\ ` ${}", async (t) => {
await assertSnapshot(t, "\\ ` ${}");
});

Deno.test("Snapshot Test - Default serializer", async (t) => {
await assertSnapshot(t, "a\nb\tc");
});

Deno.test("Snapshot Test - Multi-Line Strings", async (t) => {
await t.step("string", async (t) => {
await assertSnapshot(
Expand Down

0 comments on commit 428154a

Please sign in to comment.