From c6d4067a0e9d0b1d45ee1305358fa1c9e89a185b Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 23 Jun 2020 15:53:45 -0700 Subject: [PATCH] mocks: Remove __mocks__/redux-mock-store.js. It looks like this was added with the idea that we'd use it in more places than we actually have. It adds a slight bit of convenience; with this mock, we can avoid having to write `configureStore([thunk])` a bunch of times. But that's a very small amount of boilerplate. The mock doesn't seem to have any other purpose that might be part of a unit-testing strategy. Removing it makes it possible to use the libdef without contorting it more drastically than we already have. [cherry-picked from #4171] --- __mocks__/redux-mock-store.js | 6 ------ src/message/__tests__/fetchActions-test.js | 5 ++++- src/message/__tests__/messageActions-test.js | 5 ++++- 3 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 __mocks__/redux-mock-store.js diff --git a/__mocks__/redux-mock-store.js b/__mocks__/redux-mock-store.js deleted file mode 100644 index 6282d915afd..00000000000 --- a/__mocks__/redux-mock-store.js +++ /dev/null @@ -1,6 +0,0 @@ -import configureMockStore from 'redux-mock-store'; // eslint-disable-line -import thunk from 'redux-thunk'; - -const mockStore = configureMockStore([thunk]); - -export default mockStore; diff --git a/src/message/__tests__/fetchActions-test.js b/src/message/__tests__/fetchActions-test.js index 4bc5901497d..2c3ab150460 100644 --- a/src/message/__tests__/fetchActions-test.js +++ b/src/message/__tests__/fetchActions-test.js @@ -1,9 +1,12 @@ -import mockStore from 'redux-mock-store'; // eslint-disable-line +import configureStore from 'redux-mock-store'; +import thunk from 'redux-thunk'; import { fetchMessages, fetchOlder, fetchNewer } from '../fetchActions'; import { streamNarrow, HOME_NARROW, HOME_NARROW_STR } from '../../utils/narrow'; import { navStateWithNarrow } from '../../utils/testHelpers'; +const mockStore = configureStore([thunk]); + const narrow = streamNarrow('some stream'); const streamNarrowStr = JSON.stringify(narrow); diff --git a/src/message/__tests__/messageActions-test.js b/src/message/__tests__/messageActions-test.js index 1e2d58e13ca..b8a7934acf1 100644 --- a/src/message/__tests__/messageActions-test.js +++ b/src/message/__tests__/messageActions-test.js @@ -1,9 +1,12 @@ -import mockStore from 'redux-mock-store'; // eslint-disable-line +import configureStore from 'redux-mock-store'; +import thunk from 'redux-thunk'; import { doNarrow } from '../messagesActions'; import { streamNarrow, HOME_NARROW, privateNarrow } from '../../utils/narrow'; import { navStateWithNarrow } from '../../utils/testHelpers'; +const mockStore = configureStore([thunk]); + const streamNarrowObj = streamNarrow('some stream'); const streamNarrowStr = JSON.stringify(streamNarrowObj);