Skip to content

Commit

Permalink
Merge pull request facebook#124 from kurumpa/Branch_c858b918bf4dca1a1…
Browse files Browse the repository at this point in the history
…16ff2ef8fe3e098ab2a9710

fixed tests
  • Loading branch information
fisherwebdev committed Jan 13, 2015
2 parents 0901bb7 + 5e808c7 commit 104caf6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/__tests__/Dispatcher-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ describe('Dispatcher', function() {
});

it('should throw on self-circular dependencies', function() {
var tokenA = dispatcher.register(function() {
var tokenA = dispatcher.register(function(payload) {
dispatcher.waitFor([tokenA]);
callbackA(payload);
});

var payload = {};
Expand All @@ -137,12 +138,14 @@ describe('Dispatcher', function() {
});

it('should throw on multi-circular dependencies', function() {
var tokenA = dispatcher.register(function() {
var tokenA = dispatcher.register(function(payload) {
dispatcher.waitFor([tokenB]);
callbackA(payload);
});

var tokenB = dispatcher.register(function() {
var tokenB = dispatcher.register(function(payload) {
dispatcher.waitFor([tokenA]);
callbackB(payload);
});

var payload = {};
Expand Down

0 comments on commit 104caf6

Please sign in to comment.