From 79e0558b7304b73daa2f5a0a14ec1aaecd0bb131 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 2 Nov 2019 12:53:38 +0200 Subject: [PATCH] Add some tests for built css --- test/tests/build.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/tests/build.js b/test/tests/build.js index bdfab49c..acc8c69a 100644 --- a/test/tests/build.js +++ b/test/tests/build.js @@ -34,6 +34,19 @@ describe("public folder", function() { expect(fs.existsSync(path.join(publicFolder, "css", "style.css.map"))).to.be.true; }); + it("style files contain expected content", function(done) { + fs.readFile(path.join(publicFolder, "css", "style.css"), "utf8", function(err, contents) { + expect(err).to.be.null; + + expect(contents.includes("var(--body-color)")).to.be.true; + expect(contents.includes("url(../fonts/fa-solid-900.woff2)")).to.be.true; + expect(contents.includes(".tooltipped{position:relative}")).to.be.true; + expect(contents.includes("sourceMappingURL")).to.be.true; + + done(); + }); + }); + it("javascript map is created", function() { expect(fs.existsSync(path.join(publicFolder, "js", "bundle.js.map"))).to.be.true; });