-
Notifications
You must be signed in to change notification settings - Fork 779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
start() may happen before init() #358
Comments
When running headless without a DOM, QUnit.init never runs. In that case the workaround would break stuff. Should probably refactor |
ok, you had me confused there. headless - in my simple mind - is a browser that doesn't paint to screen, it still has a dom, though. What you mean - again in my words - is a javascript shell (node, or whatever, something that is not a browser). Anyway, splitting up default config and DOM init makes sense! This doesn't solve the problem though, as tests could depend on the initialized dom, no? |
If there's no UI (aka headless), results are only available via logging callbacks. Though if the DOM is available, it needs to be update before running the first test. So yeah, for that case, the order needs to get fixed. |
Discussed with Scott in IRC, probably need to do something like this: have QUnit.start() wait for QUnit.load (if there's a dom), if there's none, init immediately. Wrap the DOM access in QUnit.init() to make that also work without DOM. |
Using Require.js we've run into a funny issue. Apparently
QUnit.init
(via window.load) is triggered after reqired resource have been loaded. SinceQUnit.config.autostart = false;
is in play, we callQUnit.start()
in the master test-file. (as suggested in this Example).The quickest solution @jzaefferer and me found is diverting calls to start() unless QUnit is initialized. Achieve with
QUnit._initialized = true;
to QUnit.init();@jzaefferer also voiced concerns this could break on headless browsers. (I have no clue what that break could be…)
The text was updated successfully, but these errors were encountered: