Skip to content

Instantly share code, notes, and snippets.

@EmperorEarth
Created January 28, 2016 18:37
Show Gist options
  • Save EmperorEarth/89f9cf249ce5544a622b to your computer and use it in GitHub Desktop.
Save EmperorEarth/89f9cf249ce5544a622b to your computer and use it in GitHub Desktop.
import React from 'react'
export function funcA(state, action) {
// do stuff
return state_new
}
import expect from 'expect'
import deepFreeze from 'deep-freeze'
import { funcA } from './bar'
function test_funcA() {
const state_0 = {}
const state_1 = {}
expect(
funcA(state_0, action_A)
).toEqual(state_1)
}
test_funcA()
console.log('All tests passed')
// https://egghead.io/lessons/javascript-redux-avoiding-object-mutations-with-object-assign-and-spread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment