mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 13:09:26 +00:00
snapshot
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
const jsdom = require("jsdom");
|
||||
|
||||
exports.startApplication = function (configFilename, exec) {
|
||||
jest.resetModules();
|
||||
// Set config sample for use in test
|
||||
@@ -14,3 +16,12 @@ exports.stopApplication = function (app) {
|
||||
app.stop();
|
||||
}
|
||||
};
|
||||
|
||||
exports.getDocument = function (url, callback) {
|
||||
jsdom.JSDOM.fromURL(url, { resources: "usable", runScripts: "dangerously" }).then((dom) => {
|
||||
dom.window.onload = function () {
|
||||
global.document = dom.window.document;
|
||||
callback();
|
||||
};
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user