Skip to content
Myr

tests - Fixing setting flags in beforeAll, so will execute correctly

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

authored by Ori Livni · committed by Ori Livni · parent dbedded · Browse files · 3 files+11 added−5 removed
This commit

State

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

Diff stats

3 files+11 added−5 removed

  • tests:+11 added−5 removed

3 files+11 added−5 removed

modified:__tests__/curry.js+3 added-1 removed
modified:__tests__/frozen.js+5 added-3 removed
6 unmodified lines
7runTests("es5", false)89function runTests(name, useProxies) {10 describe("auto freeze - " + name, () => {11 beforeAll(() => {11 setUseProxies(useProxies)12 setAutoFreeze(true)12 setUseProxies(useProxies)13 setAutoFreeze(true)14 })1516 it("never freezes the base state", () => {17 const base = {arr: [1], obj: {a: 1}}18 const next = produce(base, draft => {
118 unmodified lines
137 })138139 it("will freeze maps", () => {140 const base = new Map()139 debugger141142 const res = produce(base, draft => {143 draft.set("a", 1)144 })145 expect(() => res.set("b", 2)).toThrow(
33 unmodified lines
modified:__tests__/manual.js+3 added-1 removed
10 unmodified lines
11runTests("es5", false)1213function runTests(name, useProxies) {14 describe("manual - " + name, () => {15 beforeAll(() => {15 setUseProxies(useProxies)16 setUseProxies(useProxies)17 })1819 it("should check arguments", () => {20 expect(() => createDraft(3)).toThrowErrorMatchingSnapshot()21 const buf = new Buffer([])
117 unmodified lines