Closed dexygen closed 7 years ago
I've added the same block of code to the top of QUnit.moduleStart since after assigning to currentModule it references currentRun i.e.: currentRun.modules.push(currentModule);
Is there a reason why you cannot add the "qunit-reporter-junit.js" script before QUnit begin executing tests? Given that you filed this issue over 3 years ago, I'm thinking you may have just been running into an old bug in QUnit core that has since been fixed (by me, if memory serves) for quite some time now where the QUnit.begin
logging callbacks were being called way too early.
If this is still a problem for you with the latest QUnit 1.x
or 2.x
, please let me know and we can reopen the issue. Thanks!
I need to be able to use both Qunit's normal html output and xml output (when running a number of tests all from phantomjs). So I am unable to easily hook into QUnit.start because of how the existing code for html-output is structured, and therefore I was getting errors when QUnit.done tried to access currentRun which never got initialized.
My solution is not unlike some code you have at the top of QUnit.testStart ("// Setup default module if no module was specified"), but at the top of QUnit.done instead:
Hope this helps