mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
linting and fix defualt module test
This commit is contained in:
parent
f90856808b
commit
a9a70fd2e9
@ -90,7 +90,7 @@ function App() {
|
||||
const deprecated = require(`${global.root_path}/js/deprecated`);
|
||||
const deprecatedOptions = deprecated.configs;
|
||||
|
||||
const usedDeprecated = deprecatedOptions.filter(option => userConfig.hasOwnProperty(option));
|
||||
const usedDeprecated = deprecatedOptions.filter((option) => userConfig.hasOwnProperty(option));
|
||||
if (usedDeprecated.length > 0) {
|
||||
Log.warn(Utils.colors.warn(`WARNING! Your config is using deprecated options: ${usedDeprecated.join(", ")}. Check README and CHANGELOG for more up-to-date ways of getting the same functionality.`));
|
||||
}
|
||||
@ -236,7 +236,7 @@ function App() {
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Stops the core app. This calls each node_helper's STOP() function, if it
|
||||
|
@ -3,12 +3,12 @@ const path = require("path");
|
||||
const expect = require("chai").expect;
|
||||
const vm = require("vm");
|
||||
|
||||
before(function () {
|
||||
var basedir = path.join(__dirname, "../../..");
|
||||
const basedir = path.join(__dirname, "../../..");
|
||||
|
||||
var fileName = "js/app.js";
|
||||
var filePath = path.join(basedir, fileName);
|
||||
var code = fs.readFileSync(filePath);
|
||||
before(function () {
|
||||
const fileName = "js/app.js";
|
||||
const filePath = path.join(basedir, fileName);
|
||||
const code = fs.readFileSync(filePath);
|
||||
|
||||
this.sandbox = {
|
||||
module: {},
|
||||
@ -36,22 +36,12 @@ before(function () {
|
||||
vm.runInNewContext(code, this.sandbox, fileName);
|
||||
});
|
||||
|
||||
after(function () {
|
||||
//console.log(global);
|
||||
});
|
||||
|
||||
describe("Default modules set in modules/default/defaultmodules.js", function () {
|
||||
var expectedDefaultModules = ["alert", "calendar", "clock", "compliments", "currentweather", "helloworld", "newsfeed", "weatherforecast", "updatenotification"];
|
||||
const expectedDefaultModules = require("../../../modules/default/defaultmodules");
|
||||
|
||||
expectedDefaultModules.forEach((defaultModule) => {
|
||||
it(`contains default module "${defaultModule}"`, function () {
|
||||
expect(this.sandbox.defaultModules).to.include(defaultModule);
|
||||
});
|
||||
});
|
||||
|
||||
expectedDefaultModules.forEach((defaultModule) => {
|
||||
for (const defaultModule of expectedDefaultModules) {
|
||||
it(`contains a folder for modules/default/${defaultModule}"`, function () {
|
||||
expect(fs.existsSync(path.join(this.sandbox.global.root_path, "modules/default", defaultModule))).to.equal(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user