Skip to content

Commit 7d4e3ed

Browse files
authoredDec 5, 2022
fix: don't escape "\" in diff view (#2430)
1 parent 5a3deba commit 7d4e3ed

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
 

‎packages/vitest/src/integrations/chai/jest-matcher-utils.ts

+2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export function stringify(object: unknown, maxDepth = 10, options?: PrettyFormat
109109
try {
110110
result = prettyFormat(object, {
111111
maxDepth,
112+
escapeString: false,
112113
// min: true,
113114
plugins: PLUGINS,
114115
...options,
@@ -118,6 +119,7 @@ export function stringify(object: unknown, maxDepth = 10, options?: PrettyFormat
118119
result = prettyFormat(object, {
119120
callToJSON: false,
120121
maxDepth,
122+
escapeString: false,
121123
// min: true,
122124
plugins: PLUGINS,
123125
...options,

‎test/core/test/basic.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,8 @@ it.fails('deprecated done callback', (done) => {
5858
// @ts-expect-error deprecated done callback is not typed
5959
done()
6060
})
61+
62+
test('escaping', () => {
63+
expect(['\\123']).toEqual(['\\123'])
64+
expect('\\123').toEqual('\\123')
65+
})

0 commit comments

Comments
 (0)
Please sign in to comment.