Skip to content
Myr

test: returning an upvalue draft from a nested producer

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

authored by aleclarson · committed by Alec Larson · parent 76d4e0b · Browse files · 1 file+19 added−0 removed
This commit

State

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

Diff stats

1 file+19 added−0 removed

  • tests:+19 added−0 removed

1 file+19 added−0 removed

modified:__tests__/base.js+19 added
816 unmodified lines
817 expect(Object.isFrozen(r)).toBeFalsy()818 })819 })820 })821822 // "Upvalues" are variables from a parent scope.823 it("does not finalize upvalue drafts", () => {824 produce({a: {}, b: {}}, parent => {825 expect(produce({}, () => parent)).toBe(parent)826 parent.x // Ensure proxy not revoked.827828 expect(produce({}, () => [parent])[0]).toBe(parent)829 parent.x // Ensure proxy not revoked.830831 expect(produce({}, () => parent.a)).toBe(parent.a)832 parent.a.x // Ensure proxy not revoked.833834 // Modified parent test835 parent.c = 1836 expect(produce({}, () => [parent.b])[0]).toBe(parent.b)837 parent.b.x // Ensure proxy not revoked.838 })839 })840 })841842 it("should not try to change immutable data, see #66", () => {843 const user = require("./test-data")
511 unmodified lines