Skip to content

Commit

Permalink
remove other weird chars
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Jun 14, 2024
1 parent 7ca1f28 commit 7279642
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions internal/printer/printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3705,11 +3705,17 @@ const meta = { title: 'My App' };
t.Errorf("mismatch (-want +got):\n%s", diff)
}

snapshotName := strings.ReplaceAll(tt.name, "#", "_")
snapshotName = strings.ReplaceAll(snapshotName, "<", "_")
snapshotName = strings.ReplaceAll(snapshotName, ">", "_")
snapshotName = strings.ReplaceAll(snapshotName, ")", "_")
snapshotName = strings.ReplaceAll(snapshotName, "(", "_")
snapshotName = strings.ReplaceAll(snapshotName, ":", "_")
snapshotName = strings.ReplaceAll(snapshotName, " ", "_")
snapshotName = strings.ReplaceAll(snapshotName, "#", "_")

s := snaps.WithConfig(
snaps.Filename(
strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
strings.ReplaceAll(tt.name, ")", "_"), "(", "_"), ":", "_"), " ", "_")),
snaps.Update(false),
snaps.Filename(snapshotName),
)

snapshot := fmt.Sprintf("%s%s%s%s%s%s%s%s", "## Input\n\n", "```\n", test_utils.Dedent(code), "\n```", "\n\n## Output\n\n", "```js\n", test_utils.Dedent(output), "\n```")
Expand Down

0 comments on commit 7279642

Please sign in to comment.