Skip to content

Commit

Permalink
fix: assertion diff message handle non-writable sub-properties (#4278)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfamchon committed Oct 23, 2023
1 parent a29fece commit 7e1a0f8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/core/test/error.test.ts
Expand Up @@ -4,13 +4,26 @@ 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' },
value: {
foo: Object.defineProperty({}, 'sub_properties', {
value: { bar: 'baz' },
writable: false,
enumerable: true,
}),
},
writable: false,
enumerable: true,
})
Object.defineProperty(expected, 'root', {
value: { foo: 'NOT BAR' },
value: {
foo: Object.defineProperty({}, 'sub_properties', {
value: { bar: 'not baz' },
writable: false,
enumerable: true,
}),
},
writable: false,
enumerable: true,
})
Expand Down

0 comments on commit 7e1a0f8

Please sign in to comment.