-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hopefully someone will manage to write browser plugin that uses this. This fixes #56
- Loading branch information
Showing
6 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
exports.createdStores = []; | ||
|
||
exports.createdActions = []; | ||
|
||
exports.reset = function() { | ||
while(exports.createdStores.length) { | ||
exports.createdStores.pop(); | ||
} | ||
while(exports.createdActions.length) { | ||
exports.createdActions.pop(); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
var chai = require('chai'), | ||
assert = chai.assert, | ||
Reflux = require('../src'); | ||
|
||
describe('with the keep reset', function() { | ||
beforeEach(function () { | ||
Reflux.__keep.reset(); | ||
}); | ||
|
||
describe('when an action is created', function() { | ||
var action; | ||
|
||
beforeEach(function () { | ||
action = Reflux.createAction(); | ||
}); | ||
|
||
it('should be in the keep', function() { | ||
assert.equal(Reflux.__keep.createdActions[0], action); | ||
}); | ||
}); | ||
|
||
describe('when a store is created', function() { | ||
var store; | ||
|
||
beforeEach(function () { | ||
store = Reflux.createStore({ init: function() { /* no-op */} }); | ||
}); | ||
|
||
it('should be in the keep', function() { | ||
assert.equal(Reflux.__keep.createdStores[0], store); | ||
}); | ||
}); | ||
}); |