Skip to content

Commit

Permalink
Test: Add test for disabling HtmlReporter via element=null
Browse files Browse the repository at this point in the history
Ref #1711.
  • Loading branch information
Krinkle committed Jul 18, 2024
1 parent 368aaa0 commit d871f85
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/main/HtmlReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,23 @@ QUnit.test('options [urlConfig]', function (assert) {
));
});

QUnit.test('disable [via options.element=null]', function (assert) {
this.MockQUnit.on = function (type) {
assert.step('listen on-' + type);
};
this.MockQUnit.emit = function () {};

new QUnit.reporters.html(this.MockQUnit, {
element: null,
config: {
urlConfig: []
}
});
this.MockQUnit._do_mixed_run_full();

assert.verifySteps([], 'zero listeners when disabled');
});

QUnit.test('module selector', function (assert) {
var element = document.createElement('div');
new QUnit.reporters.html(this.MockQUnit, {
Expand Down

0 comments on commit d871f85

Please sign in to comment.