Run prettier over ALL files once

No other changes done in this commit
This commit is contained in:
Veeck
2020-05-11 22:22:32 +02:00
parent 3a5a29efc0
commit abb5dc5739
160 changed files with 2369 additions and 2210 deletions

View File

@@ -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,36 +36,28 @@ before(function() {
vm.runInNewContext(code, this.sandbox, fileName);
});
after(function() {
after(function () {
//console.log(global);
});
describe("'global.root_path' set in js/app.js", function() {
var expectedSubPaths = [
"modules",
"serveronly",
"js",
"js/app.js",
"js/main.js",
"js/electron.js",
"config"
];
describe("'global.root_path' set in js/app.js", function () {
var expectedSubPaths = ["modules", "serveronly", "js", "js/app.js", "js/main.js", "js/electron.js", "config"];
expectedSubPaths.forEach(subpath => {
it(`contains a file/folder "${subpath}"`, function() {
expectedSubPaths.forEach((subpath) => {
it(`contains a file/folder "${subpath}"`, function () {
expect(fs.existsSync(path.join(this.sandbox.global.root_path, subpath))).to.equal(true);
});
});
it("should not modify global.root_path for testing", function() {
it("should not modify global.root_path for testing", function () {
expect(global.root_path).to.equal(undefined);
});
it("should not modify global.version for testing", function() {
it("should not modify global.version for testing", function () {
expect(global.version).to.equal(undefined);
});
it("should expect the global.version equals package.json file", function() {
it("should expect the global.version equals package.json file", function () {
const versionPackage = JSON.parse(fs.readFileSync("package.json", "utf8")).version;
expect(this.sandbox.global.version).to.equal(versionPackage);
});