refactor tests in 3 categories unit, e2e and electron

This commit is contained in:
Karsten Hassel
2021-09-13 22:28:27 +02:00
parent 60e03777f3
commit 974de179e0
26 changed files with 81 additions and 100 deletions

View File

@@ -1,10 +1,7 @@
const helpers = require("./global-setup");
const fetch = require("node-fetch");
const app = require("../../js/app.js");
describe("All font files from roboto.css should be downloadable", function () {
helpers.setupTimeout(this);
let app;
const fontFiles = [];
// Statements below filters out all 'url' lines in the CSS file
const fileContent = require("fs").readFileSync(__dirname + "/../../fonts/roboto.css", "utf8");
@@ -18,20 +15,13 @@ describe("All font files from roboto.css should be downloadable", function () {
}
beforeAll(function () {
// Set config sample for use in test
process.env.MM_CONFIG_FILE = "tests/configs/without_modules.js";
return helpers
.startApplication({
args: ["js/electron.js"]
})
.then(function (startedApp) {
app = startedApp;
});
app.start();
});
afterAll(function () {
return helpers.stopApplication(app);
app.stop();
});
test.each(fontFiles)("should return 200 HTTP code for file '%s'", (fontFile, done) => {