Skip to content

Commit

Permalink
fix: don't escape "\" in diff view (#2430)
Browse files Browse the repository at this point in the history
  • Loading branch information
poyoho committed Dec 5, 2022
1 parent 5a3deba commit 7d4e3ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vitest/src/integrations/chai/jest-matcher-utils.ts
Expand Up @@ -109,6 +109,7 @@ export function stringify(object: unknown, maxDepth = 10, options?: PrettyFormat
try {
result = prettyFormat(object, {
maxDepth,
escapeString: false,
// min: true,
plugins: PLUGINS,
...options,
Expand All @@ -118,6 +119,7 @@ export function stringify(object: unknown, maxDepth = 10, options?: PrettyFormat
result = prettyFormat(object, {
callToJSON: false,
maxDepth,
escapeString: false,
// min: true,
plugins: PLUGINS,
...options,
Expand Down
5 changes: 5 additions & 0 deletions test/core/test/basic.test.ts
Expand Up @@ -58,3 +58,8 @@ it.fails('deprecated done callback', (done) => {
// @ts-expect-error deprecated done callback is not typed
done()
})

test('escaping', () => {
expect(['\\123']).toEqual(['\\123'])
expect('\\123').toEqual('\\123')
})

0 comments on commit 7d4e3ed

Please sign in to comment.