Skip to content

Commit

Permalink
mocks: Remove __mocks__/redux-mock-store.js.
Browse files Browse the repository at this point in the history
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 zulip#4171]
  • Loading branch information
chrisbobbe committed Jul 20, 2020
1 parent ad1b1d4 commit 1cc8d80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 0 additions & 6 deletions __mocks__/redux-mock-store.js

This file was deleted.

5 changes: 4 additions & 1 deletion src/message/__tests__/fetchActions-test.js
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
5 changes: 4 additions & 1 deletion src/message/__tests__/messageActions-test.js
Original file line number Diff line number Diff line change
@@ -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);

Expand Down

0 comments on commit 1cc8d80

Please sign in to comment.