Skip to content
Myr

plugins.js

This file

Path

__tests__/plugins.js

49 lines · 936 bytes · JavaScript

Last changed by

Merge pull request #536 from immerjs/multi-bundleMichel Weststratebefore adoption0d87fc8

History of this file

Take it

Merge pull request #536 from immerjs/multi-bundleMichel Weststratebefore adoption0d87fc8

lines 1–49why, one step back
1import produce, {
2 setUseProxies,3 produceWithPatches,4 applyPatches5} from "../src/immer"67describe("ES5 plugins should throw if no proxies are available", () => {8 beforeEach(() => {9 setUseProxies(false)10 })1112 afterEach(() => {13 setUseProxies(true)14 })1516 test("error when using ES5", () => {17 expect(() => {18 produce({}, function() {})19 }).toThrowErrorMatchingSnapshot()20 })21})2223test("error when using Maps", () => {24 expect(() => {25 produce(new Map(), function() {})26 }).toThrowErrorMatchingSnapshot()27})2829test("error when using patches - 1", () => {30 expect(() => {31 produce(32 {},33 function() {},34 function() {}35 )36 }).toThrowErrorMatchingSnapshot()37})3839test("error when using patches - 2", () => {40 expect(() => {41 produceWithPatches({}, function() {})42 }).toThrowErrorMatchingSnapshot()43})4445test("error when using patches - 3", () => {46 expect(() => {47 applyPatches({}, [])48 }).toThrowErrorMatchingSnapshot()49})