2017-07-24 22:08:12 +02:00
|
|
|
const helpers = require("./global-setup");
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
describe("Development console tests", function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
helpers.setupTimeout(this);
|
|
|
|
|
2021-04-08 21:12:56 +02:00
|
|
|
let app = null;
|
2017-07-24 22:08:12 +02:00
|
|
|
|
2021-06-08 00:47:40 +02:00
|
|
|
beforeAll(function () {
|
2017-02-05 11:38:01 +01:00
|
|
|
// Set config sample for use in test
|
2021-07-05 18:27:14 +02:00
|
|
|
process.env.MM_CONFIG_FILE = "tests/configs/default.js";
|
2017-02-05 11:38:01 +01:00
|
|
|
});
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
describe("Without 'dev' commandline argument", function () {
|
2021-06-08 00:47:40 +02:00
|
|
|
beforeAll(function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
return helpers
|
|
|
|
.startApplication({
|
|
|
|
args: ["js/electron.js"]
|
|
|
|
})
|
2020-05-11 22:22:32 +02:00
|
|
|
.then(function (startedApp) {
|
2017-07-24 22:08:12 +02:00
|
|
|
app = startedApp;
|
|
|
|
});
|
|
|
|
});
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2021-06-08 00:47:40 +02:00
|
|
|
afterAll(function () {
|
2017-07-24 22:08:12 +02:00
|
|
|
return helpers.stopApplication(app);
|
|
|
|
});
|
2017-02-05 11:38:01 +01:00
|
|
|
|
2021-06-08 00:47:40 +02:00
|
|
|
it("should not open dev console when absent", async function () {
|
2021-06-18 12:42:13 +02:00
|
|
|
await app.client.waitUntilWindowLoaded();
|
|
|
|
return expect(await app.browserWindow.isDevToolsOpened()).toBe(false);
|
2017-02-05 11:38:01 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-06-18 21:39:55 +02:00
|
|
|
describe("With 'dev' commandline argument", function () {
|
|
|
|
beforeAll(function () {
|
|
|
|
return helpers
|
|
|
|
.startApplication({
|
|
|
|
args: ["js/electron.js", "dev"]
|
|
|
|
})
|
|
|
|
.then(function (startedApp) {
|
|
|
|
app = startedApp;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(function () {
|
|
|
|
return helpers.stopApplication(app);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should open dev console when provided", async function () {
|
|
|
|
expect(await app.client.getWindowCount()).toBe(2);
|
|
|
|
});
|
|
|
|
});
|
2017-02-05 11:38:01 +01:00
|
|
|
});
|