Fixing consistency of signatures.

This commit is contained in:
Christian Pekeler
2016-08-27 15:24:28 -06:00
parent 1236550ba6
commit 4a973d7ac4
4 changed files with 18 additions and 18 deletions
+6 -6
View File
@@ -10,16 +10,16 @@ test('hooks', function (t) {
onError: function (err) {
t.equal(err.message, 'effect error', 'onError: receives err')
},
onAction: function (action, state, name, caller, createSend) {
onAction: function (data, state, name, caller, createSend) {
if (name === 'explodes') return
t.deepEqual(action, {foo: 'bar'}, 'onAction: action data')
t.deepEqual(data, {foo: 'bar'}, 'onAction: action data')
t.equal(state.clicks, 0, 'onAction: current state: 0 clicks')
t.equal(name, 'click', 'onAction: action name')
t.equal(caller, 'view: /', 'onAction: caller name')
t.equal(typeof createSend, 'function', 'onAction: createSend fn')
},
onStateChange: function (action, state, prev, createSend) {
t.deepEqual(action, {foo: 'bar'}, 'onState: action data')
onStateChange: function (data, state, prev, createSend) {
t.deepEqual(data, {foo: 'bar'}, 'onState: action data')
t.deepEqual(state.clicks, 1, 'onState: new state: 1 clicks')
t.deepEqual(prev.clicks, 0, 'onState: prev state: 0 clicks')
}
@@ -30,10 +30,10 @@ test('hooks', function (t) {
clicks: 0
},
reducers: {
click: (action, state) => ({clicks: state.clicks + 1})
click: (data, state) => ({clicks: state.clicks + 1})
},
effects: {
explodes: (action, state, send, done) => {
explodes: (data, state, send, done) => {
setTimeout(() => done(new Error('effect error')), 5)
}
}