Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Lautenbach committed Aug 20, 2020
1 parent 55cf8eb commit 4fdb0a5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/unit/is-serializable-props.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,13 @@ Reason: Circular references cannot be expressed in JSON (references: \`.k\`)."
})
).toBe(true)
})

it('allows identical object instances in an array', () => {
const obj = { foo: 'bar' }
const arr = [obj, obj]
const objWithArr = { deep: { arr } }

expect(isSerializableProps('/', 'test', { arr })).toBe(true)
expect(isSerializableProps('/', 'test', { objWithArr })).toBe(true)
})
})

0 comments on commit 4fdb0a5

Please sign in to comment.