-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: assertion diff message now handle non writable property correctly (
- Loading branch information
1 parent
306b233
commit f75ab65
Showing
4 changed files
with
58 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { processError } from '@vitest/runner/utils' | ||
import { expect, test } from 'vitest' | ||
|
||
test('Can correctly process error where actual and expected contains non writable properties', () => { | ||
const actual = {} | ||
const expected = {} | ||
Object.defineProperty(actual, 'root', { | ||
value: { foo: 'bar' }, | ||
writable: false, | ||
enumerable: true, | ||
}) | ||
Object.defineProperty(expected, 'root', { | ||
value: { foo: 'NOT BAR' }, | ||
writable: false, | ||
enumerable: true, | ||
}) | ||
|
||
const err = { | ||
actual, | ||
expected, | ||
} | ||
|
||
expect(() => processError(err)).not.toThrow(TypeError) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters