Merge branch 'develop' into check-week-number

This commit is contained in:
Rodrigo Ramírez Norambuena 2017-04-18 22:59:07 -03:00 committed by GitHub
commit dce8edf742
4 changed files with 72 additions and 1 deletions

10
.gitignore vendored
View File

@ -65,3 +65,13 @@ Temporary Items
# Ignore changes to the custom css files.
/css/custom.css
# Vim
## swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
## diff patch
*.orig
*.rej
*.bak

View File

@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add task to check configuration file.
- Add test check URLs of vendors.
- Add test of match current week number on clock module with showWeek configuration.
- Add test default modules present modules/default/defaultmodules.js.
### Updated
- Added missing keys to Polish translation.

View File

@ -41,8 +41,8 @@
"grunt-markdownlint": "^1.0.13",
"grunt-stylelint": "latest",
"grunt-yamllint": "latest",
"jshint": "^2.9.4",
"http-auth": "^3.1.3",
"jshint": "^2.9.4",
"mocha": "^3.2.0",
"spectron": "^3.4.1",
"stylelint-config-standard": "latest",

View File

@ -0,0 +1,60 @@
var fs = require("fs");
var path = require("path");
var chai = require("chai");
var expect = chai.expect;
var vm = require("vm");
before(function() {
var basedir = path.join(__dirname, "../../..");
var fileName = "js/app.js";
var filePath = path.join(basedir, fileName);
var code = fs.readFileSync(filePath);
this.sandbox = {
module: {},
__dirname: path.dirname(filePath),
global: {},
console: {
log: function() { /*console.log("console.log(", arguments, ")");*/ }
},
process: {
on: function() { /*console.log("process.on called with: ", arguments);*/ },
env: {}
}
};
this.sandbox.require = function(filename) {
// This modifies the global slightly,
// but supplies vm with essential code
return require(filename);
};
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"
];
expectedDefaultModules.forEach(defaultModule => {
it(`contains default module "${defaultModule}"`, function() {
expect(this.sandbox.defaultModules).to.include(defaultModule);
});
});
});