Skip to content
Myr

chore(test): cover circular symbol references in produce (#1309)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Bennett Payoyo · committed by GitHub · parent 381654e · Browse files · 1 file+13 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Bennett Payoyo <Yahiro025@users.noreply.github.com>

Diff stats

1 file+13 added−0 removed

  • tests:+13 added−0 removed

1 file+13 added−0 removed

modified:__tests__/regressions.js+13 added
10 unmodified lines
1112enableMapSet()13enablePatches()1415test("#1106 handles circular references in symbol properties", () => {16 const symbol = Symbol("parent")17 const parent = {value: 0}18 const child = {[symbol]: parent}19 parent.child = child2021 const next = new Immer().produce(parent, draft => {22 draft.value = 123 })2425 expect(next.value).toBe(1)26})2728runBaseTest("proxy (no freeze)", true, false)29runBaseTest("proxy (autofreeze)", true, true)30runBaseTest("es5 (no freeze)", false, false)31runBaseTest("es5 (autofreeze)", false, true)
285 unmodified lines