diff --git a/tests/spec/core/linter-rules/no-headingless-sections-spec.js b/tests/spec/core/linter-rules/no-headingless-sections-spec.js index f45dfaf490..467f579a2f 100644 --- a/tests/spec/core/linter-rules/no-headingless-sections-spec.js +++ b/tests/spec/core/linter-rules/no-headingless-sections-spec.js @@ -11,6 +11,13 @@ describe("Core Linter Rule - 'no-headingless-sections'", () => { }); }); const doc = document.implementation.createHTMLDocument("test doc"); + beforeEach(() => { + // Make sure every unordered test get an empty document + // See: https://github.com/w3c/respec/pull/1495 + while (doc.body.firstChild) { + doc.body.removeChild(doc.body.firstChild); + } + }); it("returns error when heading is missing section", async () => { const section = doc.createElement("section"); doc.body.appendChild(section);