refactor: nicer immediate method
This commit is contained in:
parent
b5d49c5786
commit
52f8d53937
|
@ -15,18 +15,21 @@ describe('behavior', () => {
|
|||
});
|
||||
it('may resolve immediately', (done) => {
|
||||
const actions = new Actions();
|
||||
context.add('test', 69);
|
||||
context.add('test2', 420);
|
||||
let total = 0;
|
||||
const increment = () => total++;
|
||||
context.add('increment', increment);
|
||||
actions.fromJSON({
|
||||
type: 'actions',
|
||||
traversals: [
|
||||
buildTraversal(['test']),
|
||||
buildTraversal(['test2']),
|
||||
buildTraversal(['increment']),
|
||||
buildTraversal(['increment']),
|
||||
buildTraversal(['increment']),
|
||||
],
|
||||
});
|
||||
actions.on('actionsFinished', done);
|
||||
actions.tick(context, 0);
|
||||
expect(actions.index).to.equal(0);
|
||||
expect(total).to.equal(3);
|
||||
});
|
||||
it('may defer', async () => {
|
||||
const actions = new Actions();
|
||||
|
|
Loading…
Reference in New Issue
Block a user