it('Should call dispatch and getState exactly once.', () => { return doubleAsync()(_dispatchSpy, _getStateSpy) .then(() => { _dispatchSpy.should.have.been.calledOnce _getStateSpy.should.have.been.calledOnce }) })
it('Should produce a state that is double the previous state.', () => { _globalState = { counter: 2 } return doubleAsync()(_dispatchSpy, _getStateSpy) .then(() => { _dispatchSpy.should.have.been.calledOnce _getStateSpy.should.have.been.calledOnce expect(_globalState.counter).to.equal(4) return doubleAsync()(_dispatchSpy, _getStateSpy) }) .then(() => { _dispatchSpy.should.have.been.calledTwice _getStateSpy.should.have.been.calledTwice expect(_globalState.counter).to.equal(8) }) })
.then(() => { _dispatchSpy.should.have.been.calledOnce _getStateSpy.should.have.been.calledOnce expect(_globalState.counter).to.equal(4) return doubleAsync()(_dispatchSpy, _getStateSpy) })
it('Should return a promise from that thunk that gets fulfilled.', () => { return doubleAsync()(_dispatchSpy, _getStateSpy).should.eventually.be.fulfilled })
it('Should return a function (is a thunk).', () => { expect(doubleAsync()).to.be.a('function') })