我正在使用redux工具包传递/注入Redux的Reaction组件.因为它们是不可序列化的,所以我已经成功地禁用了该配置的判断:
const store = configureStore({
reducer: {
...
},
devTools: process.env.NODE_ENV === 'development',
middleware: (getDefaultMiddleware) => {
console.log('IN MIDDLEWARE'); // gets logged in tests, so jests gets to this point
return getDefaultMiddleware({
serializableCheck: false, // works in the app, but doesn't in tests - I still see the error log there
});
},
});
这在应用程序中工作得很好,但出于某种原因,这无助于 suppress 错误A non-serializable value was detected in an action
Ging Logging in JEST测试.我不明白为什么它还在那里,把我的测试日志(log)弄得乱七八糟.