From 9872bd5137fc8adc69409ca614dfa38a788e8187 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Wed, 5 Dec 2018 15:25:09 +0900 Subject: [PATCH] add pre test --- test/baselines/pre | 4 ++++ test/cases/pre.html | 5 +++++ test/runner.js | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/baselines/pre create mode 100644 test/cases/pre.html diff --git a/test/baselines/pre b/test/baselines/pre new file mode 100644 index 0000000..301db9d --- /dev/null +++ b/test/baselines/pre @@ -0,0 +1,4 @@ + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis + nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + diff --git a/test/cases/pre.html b/test/cases/pre.html new file mode 100644 index 0000000..ee63f41 --- /dev/null +++ b/test/cases/pre.html @@ -0,0 +1,5 @@ +
+  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+  incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+  nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
diff --git a/test/runner.js b/test/runner.js index 501d77b..2075194 100644 --- a/test/runner.js +++ b/test/runner.js @@ -17,7 +17,7 @@ describe("Tests", () => { const converted = innerText(/** @type {HTMLElement} */(fragment.firstElementChild)); const baselineName = caseName.split(".")[0]; const baseline = fs.readFileSync(path.join(baselines, baselineName), "utf-8"); - expect(converted).toBe(baseline.trimEnd()); + expect(converted + "\n").toBe(baseline); }); } });