From 6a5a85b20bf6fe02eef4114d46b9a0e742334014 Mon Sep 17 00:00:00 2001 From: Christian Alfoni Date: Sun, 14 Aug 2016 21:42:11 +0200 Subject: [PATCH] feat(dependency): cerebral 1.0 supported --- package.json | 2 +- tests/index.js | 34 ++++++++++++++++------------------ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 0ea44ba..6e5ad78 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/tests/index.js b/tests/index.js index 5f12e16..de8e484 100644 --- a/tests/index.js +++ b/tests/index.js @@ -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() }) } @@ -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() }) }