Skip to content

Commit

Permalink
Merge pull request #772 from Turbo87/fix-null
Browse files Browse the repository at this point in the history
Fix `assert.dom(null).exists()` case
  • Loading branch information
Turbo87 authored Jul 30, 2020
2 parents 7d0a175 + 25aae7b commit 191afea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/qunit-dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ QUnit.assert.dom = function (
}

rootElement = rootElement || this.dom.rootElement || document;
return new DOMAssertions(target || rootElement, rootElement, this);

if (arguments.length === 0) {
target = rootElement;
}

return new DOMAssertions(target, rootElement, this);
};

function isValidRootElement(element: any): element is Element {
Expand Down

0 comments on commit 191afea

Please sign in to comment.