Skip to content

Defer "begin" callback until test run actually starts #659

@JamesMGreene

Description

@JamesMGreene

Currently in QUnit.load, we immediately invoke the logging callbacks for "begin" (a.k.a. "runStart") when the page loads, even if QUnit.config.autostart is set to false and thus won't actually begin yet: src/core.js#L404-L406

This seems inaccurate both from a timing perspective (for reporters marking the time of events) as well as from a Test.count perspective: if the run hasn't begun yet, it may be because there are still tests loading asynchronously, and thus their count would not be included in the data sent with the "begin" event.

This logging callback should be called from somewhere inside the QUnit.start execution stack [and only fired once, when the test run actually begins] instead.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions