Skip to content

Commit

Permalink
Cover utils with unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinKasprowicz authored May 30, 2018
2 parents 7b616ef + c06734d commit 8d85eee
Show file tree
Hide file tree
Showing 6 changed files with 652 additions and 51 deletions.
2 changes: 1 addition & 1 deletion apps/xprof_gui/priv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"start": "node scripts/start.js",
"start:with-cowboy": "node scripts/start-with-cowboy.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js --env=jsdom",
"test": "node --inspect scripts/test.js --env=jsdom",
"test:single-run": "node scripts/test.js --env=jsdom --coverage"
},
"lint-staged": {
Expand Down
34 changes: 17 additions & 17 deletions apps/xprof_gui/priv/src/store/configureStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ import rootReducer from '../reducers';

export default function configureStore(initialState) {
// Uncomment for logging
const logger = store => next => (action) => {
if (
action.type &&
action.type !== 'UPDATE_DATA' &&
action.type !== 'UPDATE_MONITORED_FUNCTIONS' &&
action.type !== 'UPDATE_CALLS'
) {
console.group(action.type);
console.info('dispatching', action);
console.log('next state', store.getState());
console.groupEnd(action.type);
}
const result = next(action);
return result;
};
// const logger = store => next => (action) => {
// if (
// action.type &&
// action.type !== 'UPDATE_DATA' &&
// action.type !== 'UPDATE_MONITORED_FUNCTIONS' &&
// action.type !== 'UPDATE_CALLS'
// ) {
// console.group(action.type);
// console.info('dispatching', action);
// console.log('next state', store.getState());
// console.groupEnd(action.type);
// }
// const result = next(action);
// return result;
// };

const store = createStore(
rootReducer,
initialState,
// applyMiddleware(ReduxThunk),
applyMiddleware(ReduxThunk),
// Uncomment for logging
applyMiddleware(logger, ReduxThunk),
// applyMiddleware(logger, ReduxThunk),
);

return store;
Expand Down
Loading

0 comments on commit 8d85eee

Please sign in to comment.