mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
linting
This commit is contained in:
parent
a69d08b554
commit
38f7716738
@ -31,37 +31,37 @@ describe("File js/class", function() {
|
|||||||
const obj = clone(expected);
|
const obj = clone(expected);
|
||||||
expect(obj).to.deep.equal(expected);
|
expect(obj).to.deep.equal(expected);
|
||||||
expect(expected === obj).to.equal(false);
|
expect(expected === obj).to.equal(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should clone number", function() {
|
it("should clone number", function() {
|
||||||
let expected = 1;
|
let expected = 1;
|
||||||
let obj = clone(expected);
|
let obj = clone(expected);
|
||||||
expect(obj).to.equal(expected);
|
expect(obj).to.equal(expected);
|
||||||
|
|
||||||
expected = 1.23;
|
expected = 1.23;
|
||||||
obj = clone(expected);
|
obj = clone(expected);
|
||||||
expect(obj).to.equal(expected);
|
expect(obj).to.equal(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should clone string", function() {
|
it("should clone string", function() {
|
||||||
const expected = "Perfect stranger";
|
const expected = "Perfect stranger";
|
||||||
const obj = clone(expected);
|
const obj = clone(expected);
|
||||||
expect(obj).to.equal(expected);
|
expect(obj).to.equal(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should clone undefined", function() {
|
it("should clone undefined", function() {
|
||||||
const expected = undefined;
|
const expected = undefined;
|
||||||
const obj = clone(expected);
|
const obj = clone(expected);
|
||||||
expect(obj).to.equal(expected);
|
expect(obj).to.equal(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should clone null", function() {
|
it("should clone null", function() {
|
||||||
const expected = null;
|
const expected = null;
|
||||||
const obj = clone(expected);
|
const obj = clone(expected);
|
||||||
expect(obj).to.equal(expected);
|
expect(obj).to.equal(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should clone nested object", function() {
|
it("should clone nested object", function() {
|
||||||
const expected = {
|
const expected = {
|
||||||
name: "fewieden",
|
name: "fewieden",
|
||||||
link: "https://github.com/fewieden",
|
link: "https://github.com/fewieden",
|
||||||
@ -81,27 +81,27 @@ describe("File js/class", function() {
|
|||||||
expect(expected.properties.items === obj.properties.items).to.equal(false);
|
expect(expected.properties.items === obj.properties.items).to.equal(false);
|
||||||
expect(expected.properties.items[0] === obj.properties.items[0]).to.equal(false);
|
expect(expected.properties.items[0] === obj.properties.items[0]).to.equal(false);
|
||||||
expect(expected.properties.items[1] === obj.properties.items[1]).to.equal(false);
|
expect(expected.properties.items[1] === obj.properties.items[1]).to.equal(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Test lockstring code", function() {
|
describe("Test lockstring code", function() {
|
||||||
let log;
|
let log;
|
||||||
|
|
||||||
before(function() {
|
before(function() {
|
||||||
log = dom.window.Log.log;
|
log = dom.window.Log.log;
|
||||||
dom.window.Log.log = function cmp(str) {
|
dom.window.Log.log = function cmp(str) {
|
||||||
expect(str).to.equal("lockStrings");
|
expect(str).to.equal("lockStrings");
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
after(function() {
|
after(function() {
|
||||||
dom.window.Log.log = log;
|
dom.window.Log.log = log;
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should clone object and log lockStrings", function() {
|
it("should clone object and log lockStrings", function() {
|
||||||
const expected = {name: "Module", lockStrings: "stringLock"};
|
const expected = {name: "Module", lockStrings: "stringLock"};
|
||||||
const obj = clone(expected);
|
const obj = clone(expected);
|
||||||
expect(obj).to.deep.equal(expected);
|
expect(obj).to.deep.equal(expected);
|
||||||
expect(expected === obj).to.equal(false);
|
expect(expected === obj).to.equal(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -3,15 +3,15 @@ const expect = chai.expect;
|
|||||||
const deprecated = require("../../../js/deprecated");
|
const deprecated = require("../../../js/deprecated");
|
||||||
|
|
||||||
describe("Deprecated", function() {
|
describe("Deprecated", function() {
|
||||||
it("should be an object", function() {
|
it("should be an object", function() {
|
||||||
expect(deprecated).to.be.an("object");
|
expect(deprecated).to.be.an("object");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should contain configs array with deprecated options as strings", function() {
|
it("should contain configs array with deprecated options as strings", function() {
|
||||||
expect(deprecated.configs).to.be.an("array");
|
expect(deprecated.configs).to.be.an("array");
|
||||||
for (let option of deprecated.configs) {
|
for (let option of deprecated.configs) {
|
||||||
expect(option).to.be.an("string");
|
expect(option).to.be.an("string");
|
||||||
}
|
}
|
||||||
expect(deprecated.configs).to.include("kioskmode");
|
expect(deprecated.configs).to.include("kioskmode");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user