0
この部分をJestでテストしたいのですが、いくつか問題があります。Jestテストの "module"オブジェクトの値を変更してください
私は関数を呼び出す前に値を変更しようと試みてきました:
module.hot = { accept: jest.fn() }
console.log(module.hot) // This print the assigned value
...
configureStore({ initialState, history })
module.hot
値は、呼び出された関数で設定されていません。
const configureStore = ({ initialState, history }) => {
...
console.log(module.hot) // This print "undefined"
if (module.hot) {
module.hot.accept('reducers',() => {
store.replaceReducer(reducers)
})
}
}
Jestは特定の方法で 'モジュール'オブジェクトを管理しますか?