mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Use es6 notation in font tests
This commit is contained in:
parent
ef2ff50089
commit
7f1a3df25b
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user