From 7f1a3df25bdbd53d1dc876b51492932cbdeece91 Mon Sep 17 00:00:00 2001 From: rejas Date: Wed, 17 Mar 2021 22:34:32 +0100 Subject: [PATCH] Use es6 notation in font tests --- tests/e2e/fonts.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e/fonts.js b/tests/e2e/fonts.js index c8c2a063..d6d65c0b 100644 --- a/tests/e2e/fonts.js +++ b/tests/e2e/fonts.js @@ -8,12 +8,12 @@ const describe = global.describe; describe("All font files from roboto.css should be downloadable", function () { helpers.setupTimeout(this); - var app; - var fontFiles = []; + let app; + const fontFiles = []; // Statements below filters out all 'url' lines in the CSS file - var fileContent = require("fs").readFileSync(__dirname + "/../../fonts/roboto.css", "utf8"); - var regex = /\burl\(['"]([^'"]+)['"]\)/g; - var match = regex.exec(fileContent); + const fileContent = require("fs").readFileSync(__dirname + "/../../fonts/roboto.css", "utf8"); + const regex = /\burl\(['"]([^'"]+)['"]\)/g; + let match = regex.exec(fileContent); while (match !== null) { // Push 1st match group onto fontFiles stack fontFiles.push(match[1]); @@ -39,7 +39,7 @@ describe("All font files from roboto.css should be downloadable", function () { }); forEach(fontFiles).it("should return 200 HTTP code for file '%s'", (fontFile, done) => { - var fontUrl = "http://localhost:8080/fonts/" + fontFile; + const fontUrl = "http://localhost:8080/fonts/" + fontFile; fetch(fontUrl).then((res) => { expect(res.status).to.equal(200); done();