Skip to content

Commit

Permalink
Merge pull request #19 from cerebral/ceb1.0
Browse files Browse the repository at this point in the history
feat(dependency): cerebral 1.0 supported
  • Loading branch information
christianalfoni authored Aug 14, 2016
2 parents 7ccd6fc + 6a5a85b commit ef5005f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"validate-commit-msg": "^2.6.1"
},
"peerDependencies": {
"cerebral": "^0.35.0-0"
"cerebral": "^0.35.0-0 || ^1.0.0"
},
"dependencies": {
"cerebral-module-signal-store": "^0.2.0-0"
Expand Down
34 changes: 16 additions & 18 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ suite['should store details about mutations'] = function (test) {

async(function () {
var action = ctrl.getServices().devtools.store.getSignals()[0].branches[0]
test.deepEqual(action.mutations[0], {
name: 'set',
path: ['foo'],
args: ['bar']
})
test.ok(action.mutations[0].datetime)
test.equals(action.mutations[0].name, 'set')
test.deepEqual(action.mutations[0].path, ['foo'])
test.deepEqual(action.mutations[0].args, ['bar'])
test.done()
})
}
Expand All @@ -130,26 +129,25 @@ suite['should store details about mutations correctly across sync and async sign
ctrl.addSignals({
'test': signalSync
})
function ActionB (args) { args.output() }
ActionB.async = true
var signalAsync = [
[
function ActionB (args) { args.output() }
], function ActionC (args) {
ActionB, function ActionC (args) {
args.state.set('foo', 'bar')

async(function () {
var actionAsync = ctrl.getServices().devtools.store.getSignals()[0].branches[1]
test.deepEqual(actionAsync.mutations[0], {
name: 'set',
path: ['foo'],
args: ['bar']
})
test.ok(actionAsync.mutations[0].datetime)
test.equals(actionAsync.mutations[0].name, 'set')
test.deepEqual(actionAsync.mutations[0].path, ['foo'])
test.deepEqual(actionAsync.mutations[0].args, ['bar'])

var action = ctrl.getServices().devtools.store.getSignals()[0].branches[0][0].signals[0].branches[0]
test.deepEqual(action.mutations[0], {
name: 'set',
path: ['foo'],
args: ['bar']
})
test.ok(action.mutations[0].datetime)
test.equals(action.mutations[0].name, 'set')
test.deepEqual(action.mutations[0].path, ['foo'])
test.deepEqual(action.mutations[0].args, ['bar'])

test.done()
})
}
Expand Down

0 comments on commit ef5005f

Please sign in to comment.