mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
fix logger.js
This commit is contained in:
parent
8224a6ac35
commit
c67320f185
@ -30,7 +30,7 @@
|
|||||||
enableLog = process.env.JEST_WORKER_ID === undefined;
|
enableLog = process.env.JEST_WORKER_ID === undefined;
|
||||||
} else {
|
} else {
|
||||||
// in browser and not running with jsdom
|
// in browser and not running with jsdom
|
||||||
enableLog = typeof window === "object" && window.name === "nodejs";
|
enableLog = typeof window === "object" && window.name !== "jsdom";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enableLog) {
|
if (enableLog) {
|
||||||
|
@ -21,6 +21,7 @@ exports.stopApplication = function () {
|
|||||||
exports.getDocument = function (callback, ms) {
|
exports.getDocument = function (callback, ms) {
|
||||||
const url = "http://" + (config.address || "localhost") + ":" + (config.port || "8080");
|
const url = "http://" + (config.address || "localhost") + ":" + (config.port || "8080");
|
||||||
jsdom.JSDOM.fromURL(url, { resources: "usable", runScripts: "dangerously" }).then((dom) => {
|
jsdom.JSDOM.fromURL(url, { resources: "usable", runScripts: "dangerously" }).then((dom) => {
|
||||||
|
dom.window.name = "jsdom";
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
global.document = dom.window.document;
|
global.document = dom.window.document;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user