mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 21:00:57 +00:00
Run prettier over ALL files once
No other changes done in this commit
This commit is contained in:
@@ -3,7 +3,7 @@ var path = require("path");
|
||||
var expect = require("chai").expect;
|
||||
var vm = require("vm");
|
||||
|
||||
before(function() {
|
||||
before(function () {
|
||||
var basedir = path.join(__dirname, "../../..");
|
||||
|
||||
var fileName = "js/app.js";
|
||||
@@ -15,15 +15,19 @@ before(function() {
|
||||
__dirname: path.dirname(filePath),
|
||||
global: {},
|
||||
console: {
|
||||
log: function() { /*console.log("console.log(", arguments, ")");*/ }
|
||||
log: function () {
|
||||
/*console.log("console.log(", arguments, ")");*/
|
||||
}
|
||||
},
|
||||
process: {
|
||||
on: function() { /*console.log("process.on called with: ", arguments);*/ },
|
||||
on: function () {
|
||||
/*console.log("process.on called with: ", arguments);*/
|
||||
},
|
||||
env: {}
|
||||
}
|
||||
};
|
||||
|
||||
this.sandbox.require = function(filename) {
|
||||
this.sandbox.require = function (filename) {
|
||||
// This modifies the global slightly,
|
||||
// but supplies vm with essential code
|
||||
return require(filename);
|
||||
@@ -32,32 +36,21 @@ before(function() {
|
||||
vm.runInNewContext(code, this.sandbox, fileName);
|
||||
});
|
||||
|
||||
after(function() {
|
||||
after(function () {
|
||||
//console.log(global);
|
||||
});
|
||||
|
||||
describe("Default modules set in modules/default/defaultmodules.js", function() {
|
||||
describe("Default modules set in modules/default/defaultmodules.js", function () {
|
||||
var expectedDefaultModules = ["alert", "calendar", "clock", "compliments", "currentweather", "helloworld", "newsfeed", "weatherforecast", "updatenotification"];
|
||||
|
||||
var expectedDefaultModules = [
|
||||
"alert",
|
||||
"calendar",
|
||||
"clock",
|
||||
"compliments",
|
||||
"currentweather",
|
||||
"helloworld",
|
||||
"newsfeed",
|
||||
"weatherforecast",
|
||||
"updatenotification"
|
||||
];
|
||||
|
||||
expectedDefaultModules.forEach(defaultModule => {
|
||||
it(`contains default module "${defaultModule}"`, function() {
|
||||
expectedDefaultModules.forEach((defaultModule) => {
|
||||
it(`contains default module "${defaultModule}"`, function () {
|
||||
expect(this.sandbox.defaultModules).to.include(defaultModule);
|
||||
});
|
||||
});
|
||||
|
||||
expectedDefaultModules.forEach(defaultModule => {
|
||||
it(`contains a folder for modules/default/${defaultModule}"`, function() {
|
||||
expectedDefaultModules.forEach((defaultModule) => {
|
||||
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);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user