Created
January 28, 2016 18:37
-
-
Save EmperorEarth/89f9cf249ce5544a622b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
export function funcA(state, action) { | |
// do stuff | |
return state_new | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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