From e1b08b273911b439cf53d467f97b19c8e2e1270b Mon Sep 17 00:00:00 2001 From: Simon Grimshaw Date: Mon, 4 Jun 2018 21:51:57 +0100 Subject: [PATCH] Removing dependency on redux-mock-store. --- .../ReactRedux-CSharp/ClientApp/package.json | 3 --- .../ReactRedux-CSharp/ClientApp/src/App.test.js | 13 +++++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/package.json b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/package.json index b10fa77cb7..8014d1c71e 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/package.json +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/package.json @@ -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" } } diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/App.test.js b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/App.test.js index 3aaedff036..cdef8cb4e7 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/App.test.js +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/App.test.js @@ -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( - + , div); -}); +}); \ No newline at end of file