Redux-persist: Remore extraneous console output

Created on 23 Dec 2017  ·  5Comments  ·  Source: rt2zz/redux-persist

Output when running Jest on passing tests. Clutters test results.

  ● Console

    console.log console.js:236
      %c action %cpersist/PERSIST %c@ 17:58:14.314 color: gray; font-weight: lighter; color: inherit; color: gray; font-weight: lighter;
    console.log node_modules/redux-logger/dist/redux-logger.js:1
      %c prev state color: #9E9E9E; font-weight: bold { traps: {}, results: {} }
    console.log node_modules/redux-logger/dist/redux-logger.js:1
      %c action     color: #03A9F4; font-weight: bold { type: 'persist/PERSIST',
        register: [Function: register],
        rehydrate: [Function: rehydrate] }
    console.log node_modules/redux-logger/dist/redux-logger.js:1
      %c next state color: #4CAF50; font-weight: bold { traps: {},
        results: {},
        _persist: { version: -1, rehydrated: false } }
    console.log console.js:236
      %c action %cpersist/REHYDRATE %c@ 17:58:14.362 color: gray; font-weight: lighter; color: inherit; color: gray; font-weight: lighter;
    console.log node_modules/redux-logger/dist/redux-logger.js:1
      %c prev state color: #9E9E9E; font-weight: bold { traps: {},
        results: {},
        _persist: { version: -1, rehydrated: false } }
    console.log node_modules/redux-logger/dist/redux-logger.js:1
      %c action     color: #03A9F4; font-weight: bold { type: 'persist/REHYDRATE',
        payload: undefined,
        err: undefined,
        key: 'root' }
    console.log node_modules/redux-logger/dist/redux-logger.js:1
      %c next state color: #4CAF50; font-weight: bold { traps: {},
        results: {},
        _persist: { version: -1, rehydrated: true } }

Most helpful comment

@rt2zz BTW, is there any way to suppress a console.error message that I'm getting while running a persist store during a test? Where it says it defaults to memory storage?

All 5 comments

that looks like redux logger middleware you're running in the tests, make sure to disable that middleware during the tests

Aha yes my bad! Thanks!!

On Wed, Jan 3, 2018 at 10:20 AM, Inaki Anduaga notifications@github.com
wrote:

that looks like redux logger middleware you're running in the tests, make
sure to disable that middleware during the tests


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rt2zz/redux-persist/issues/638#issuecomment-354978259,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAL1XjBX4G1knr_nP9f3qRUDXjiAkbbOks5tG1SEgaJpZM4RLi0Y
.

👍 note in redux-persist there should be no logs, unless you pass in debug: true via config

@rt2zz BTW, is there any way to suppress a console.error message that I'm getting while running a persist store during a test? Where it says it defaults to memory storage?

👍 note in redux-persist there should be no logs, unless you pass in debug: true via config

I have set the debug prop to false on my persistConfig object but the tests still triggering the redux logger console.logs

Was this page helpful?
0 / 5 - 0 ratings