MCPcopy Create free account
hub / github.com/caike/jQuery-Simple-Timer / addToTestQueue

Function addToTestQueue

tests/qunit-2.9.2.js:2677–2691  ·  view source on GitHub ↗

* Adds a test to the TestQueue for execution. * @param {Function} testTasksFunc * @param {Boolean} prioritize * @param {String} seed

(testTasksFunc, prioritize, seed)

Source from the content-addressed store, hash-verified

2675 * @param {String} seed
2676 */
2677 function addToTestQueue(testTasksFunc, prioritize, seed) {
2678 if (prioritize) {
2679 config.queue.splice(priorityCount++, 0, testTasksFunc);
2680 } else if (seed) {
2681 if (!unitSampler) {
2682 unitSampler = unitSamplerGenerator(seed);
2683 }
2684
2685 // Insert into a random position after all prioritized items
2686 var index = Math.floor(unitSampler() * (config.queue.length - priorityCount + 1));
2687 config.queue.splice(priorityCount + index, 0, testTasksFunc);
2688 } else {
2689 config.queue.push(testTasksFunc);
2690 }
2691 }
2692
2693 /**
2694 * Creates a seeded "sample" generator which is used for randomizing tests.

Callers

nothing calls this directly

Calls 1

unitSamplerGeneratorFunction · 0.85

Tested by

no test coverage detected