mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-30 13:09:34 +00:00
fixed and reenabled lockstring test
This commit is contained in:
parent
3e2a1e3548
commit
a756fed70b
@ -6,9 +6,11 @@ const {JSDOM} = require("jsdom");
|
|||||||
describe("File js/class", function() {
|
describe("File js/class", function() {
|
||||||
describe("Test function cloneObject", function() {
|
describe("Test function cloneObject", function() {
|
||||||
let clone;
|
let clone;
|
||||||
|
let dom;
|
||||||
|
|
||||||
before(function(done) {
|
before(function(done) {
|
||||||
const dom = new JSDOM(`<script src="${path.join(__dirname, "..", "..", "..", "js", "class.js")}">`, { runScripts: "dangerously",
|
dom = new JSDOM(`<script>var Log = {log: function() {}};</script>\
|
||||||
|
<script src="${path.join(__dirname, "..", "..", "..", "js", "class.js")}">`, { runScripts: "dangerously",
|
||||||
resources: "usable" });
|
resources: "usable" });
|
||||||
dom.window.onload = function() {
|
dom.window.onload = function() {
|
||||||
const {cloneObject} = dom.window;
|
const {cloneObject} = dom.window;
|
||||||
@ -45,17 +47,28 @@ describe("File js/class", function() {
|
|||||||
expect(undefined).to.equal(obj);
|
expect(undefined).to.equal(obj);
|
||||||
});
|
});
|
||||||
|
|
||||||
// CoverageME
|
describe("Test lockstring code", function() {
|
||||||
/*
|
let log;
|
||||||
context("Test lockstring code", function() {
|
|
||||||
it("should be return equals object", function() {
|
before(function() {
|
||||||
const expected = {name: "Module", lockStrings: "stringLock"};
|
log = dom.window.Log.log;
|
||||||
|
dom.window.Log.log = function cmp(str) {
|
||||||
|
expect(str).to.equal("lockStrings");
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
after(function() {
|
||||||
|
dom.window.Log.log = log;
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should be return equals object and log lockStrings", function() {
|
||||||
|
const expected = {name: "Module", lockStrings: "stringLock"};
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj = clone(expected);
|
obj = clone(expected);
|
||||||
expect(expected).to.deep.equal(obj);
|
expect(expected).to.deep.equal(obj);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user