|
1 | 1 | import expect from 'expect'
|
2 | 2 | import { createStore, combineReducers } from '../src/index'
|
3 |
| -import { |
4 |
| - addTodo, |
5 |
| - dispatchInMiddle, |
6 |
| - getStateInMiddle, |
7 |
| - subscribeInMiddle, |
8 |
| - unsubscribeInMiddle, |
9 |
| - throwError, |
10 |
| - unknownAction |
11 |
| -} from './helpers/actionCreators' |
| 3 | +import { addTodo, dispatchInMiddle, throwError, unknownAction } from './helpers/actionCreators' |
12 | 4 | import * as reducers from './helpers/reducers'
|
13 | 5 | import * as Rx from 'rxjs'
|
14 | 6 | import $$observable from 'symbol-observable'
|
@@ -461,31 +453,6 @@ describe('createStore', () => {
|
461 | 453 | ).toThrow(/may not dispatch/)
|
462 | 454 | })
|
463 | 455 |
|
464 |
| - it('does not allow getState() from within a reducer', () => { |
465 |
| - const store = createStore(reducers.getStateInTheMiddleOfReducer) |
466 |
| - |
467 |
| - expect(() => |
468 |
| - store.dispatch(getStateInMiddle(store.getState.bind(store))) |
469 |
| - ).toThrow(/You may not call store.getState()/) |
470 |
| - }) |
471 |
| - |
472 |
| - it('does not allow subscribe() from within a reducer', () => { |
473 |
| - const store = createStore(reducers.subscribeInTheMiddleOfReducer) |
474 |
| - |
475 |
| - expect(() => |
476 |
| - store.dispatch(subscribeInMiddle(store.subscribe.bind(store, () => {}))) |
477 |
| - ).toThrow(/You may not call store.subscribe()/) |
478 |
| - }) |
479 |
| - |
480 |
| - it('does not allow unsubscribe from subscribe() from within a reducer', () => { |
481 |
| - const store = createStore(reducers.unsubscribeInTheMiddleOfReducer) |
482 |
| - const unsubscribe = store.subscribe(() => {}) |
483 |
| - |
484 |
| - expect(() => |
485 |
| - store.dispatch(unsubscribeInMiddle(unsubscribe.bind(store))) |
486 |
| - ).toThrow(/You may not unsubscribe from a store/) |
487 |
| - }) |
488 |
| - |
489 | 456 | it('recovers from an error within a reducer', () => {
|
490 | 457 | const store = createStore(reducers.errorThrowingReducer)
|
491 | 458 | expect(() =>
|
|
0 commit comments