Skip to content

Commit d60f27c

Browse files
authored
Core: Refactor internal ProcessingQueue into class
This is motivated by the last remaining build warning from Rollup: > src/qunit.js → qunit/qunit.js... > (!) Circular dependency > src/test.js -> src/core/processing-queue.js -> src/test.js > created qunit/qunit.js in 2s ProcessingQueue needs access to the `test` function defined in test.js. Fix by turning the module into a class, that we create a singleton of in core.js (with access to test.js) and then use that singleton where we previously used ProcessingQueue statically. Closes #1740.
1 parent 2e87e2a commit d60f27c

4 files changed

Lines changed: 193 additions & 186 deletions

File tree

src/core.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const QUnit = {};
3131
// rather than partly in config.js and partly here.
3232
config.currentModule.suiteReport = runSuite;
3333

34+
config.pq = new ProcessingQueue(test);
35+
3436
let globalStartCalled = false;
3537
let runStarted = false;
3638

@@ -157,7 +159,7 @@ function scheduleBegin () {
157159

158160
function unblockAndAdvanceQueue () {
159161
config.blocking = false;
160-
ProcessingQueue.advance();
162+
config.pq.advance();
161163
}
162164

163165
export function begin () {

src/core/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ const config = {
9999
// Ref https://github.com/qunitjs/qunit/pull/1598
100100
globalHooks: {},
101101

102+
// Internal: ProcessingQueue singleton, created in /src/core.js
103+
pq: null,
104+
102105
// Internal state
103106
blocking: true,
104107
callbacks: {},

0 commit comments

Comments
 (0)