Open mgenov opened 7 years ago
As possible solution middleware may keep reference to interceptors and to re-attach them before each request but this will add additional overhead.
Any thoughts on this ?
I have the same issue
I've resolved it temporary in the project side by creating a new .spec.js file for each scenario but it's overwhelming if you have many scenarios.
As the redux-axios-middleware is caching configuration per name of the client it's not possible different store to be passed for testing unless different client is created for each test which sounds overwhelming.
Here is a sample test that illustrates the problem:
The following test fails with:
e.g the test of first test is used as it caches the store instance that was passed no matter that another store is created using mockStore.
As better feedback I've added few loggings in the interceptor too:
and this is the execution log: