Skip to content

Instantly share code, notes, and snippets.

@cartant
Last active April 25, 2019 04:27
Show Gist options
  • Save cartant/7608f289bac95bca603c850b56817b67 to your computer and use it in GitHub Desktop.
Save cartant/7608f289bac95bca603c850b56817b67 to your computer and use it in GitHub Desktop.
import { expect } from "chai";
import { produce } from "immer";
const current = [42];
const next = produce(current, draft => { draft.push(54); });
expect(current).to.deep.equal([42]);
expect(next).to.deep.equal([42, 54]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment