Skip to content

Commit

Permalink
test(core): fix task queue tests (#935)
Browse files Browse the repository at this point in the history
Fix task queue tests
  • Loading branch information
JagadeeshKaricherla-branch authored Dec 1, 2023
1 parent def75bc commit c28c20c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

module.exports = {
require: ['./node_modules/google-closure-library', './test/branch-deps.js', './node_modules/jsdom-global/register.js', './test/test-utils.js', './node_modules/sinon/lib/sinon.js'],
spec: ['./test/0_config.js','./test/1_utils.js','./test/6_branch_new.js', './test/journeys_utils.js']
spec: ['./test/0_config.js','./test/0_queue.js','./test/1_utils.js','./test/6_branch_new.js', './test/journeys_utils.js']
};
2 changes: 1 addition & 1 deletion src/0_queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ goog.provide('task_queue');
/**
* @returns {function(function(function()))}
*/
var task_queue = function() {
task_queue = function() {
var queue = [];
var next = function() {
if (queue.length) {
Expand Down
5 changes: 5 additions & 0 deletions test/0_queue.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
'use strict';
/*jshint -W079 */
var sinon = require('sinon');

goog.require('task_queue');

Expand All @@ -19,6 +21,9 @@ describe('task_queue', function() {
});
assert.strictEqual(orderCalled[0], undefined, 'Has not yet called function');
});
afterEach(function() {
clock.restore();
});

it('should queue a function and call it', function(done) {
clock.tick(11);
Expand Down

0 comments on commit c28c20c

Please sign in to comment.