heron2014 / react-todo

0 stars 0 forks source link

deep-freeze-strict #1

Open heron2014 opened 8 years ago

heron2014 commented 8 years ago

Third party library that helps to test reducers.

npm install deep-freeze-strict --save-dev

Library doesn't let you update the properties on frozen object.

If you try to modify for example action object by:

export var searchTextReducer = (state = '', action) => {
  action.something =5; // -<------ here I am deliberately updating the object 
  switch (action.type) {
  case 'SET_SEARCH_TEXT':
    return action.searchText;
  default:
    return state;
  };
};
// var df  = require('deep-freeze-strict');
  var res = reducers.searchTextReducer(df(''), df(action));

I got this error:

err