Removing dependency on redux-mock-store.
Commit migrated from dotnet/aspnetcore@e1b08b2739
This commit is contained in:
Родитель
7c95eaf597
Коммит
aba1795316
|
@ -21,8 +21,5 @@
|
|||
"build": "react-scripts build",
|
||||
"test": "react-scripts test --env=jsdom",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"devDependencies": {
|
||||
"redux-mock-store": "^1.5.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,22 @@ import React from 'react';
|
|||
import ReactDOM from 'react-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import App from './App';
|
||||
|
||||
it('renders without crashing', () => {
|
||||
const mockStore = configureStore([])({});
|
||||
const storeFake = (state) => ({
|
||||
default: () => { },
|
||||
subscribe: () => { },
|
||||
dispatch: () => { },
|
||||
getState: () => ({ ...state })
|
||||
});
|
||||
const store = storeFake({});
|
||||
|
||||
const div = document.createElement('div');
|
||||
ReactDOM.render(
|
||||
<Provider store={mockStore}>
|
||||
<Provider store={store}>
|
||||
<MemoryRouter>
|
||||
<App />
|
||||
</MemoryRouter>
|
||||
</Provider>, div);
|
||||
});
|
||||
});
|
Загрузка…
Ссылка в новой задаче