From e9a7dbdb3adf4ba1e79bb6f08cdb79304e178ffd Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Mon, 12 Feb 2018 11:35:54 +0900 Subject: [PATCH] fix: prevent unordered tests from conflicting (#1495) * fix: prevent unordered tests from conflicting * link back * 'unordered' --- .../spec/core/linter-rules/no-headingless-sections-spec.js | 7 +++++++ 1 file changed, 7 insertions(+) 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);