mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
commit
1d9a404f77
@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Add `clientonly` script to start only the electron client for a remote server.
|
- Add `clientonly` script to start only the electron client for a remote server.
|
||||||
- Add symbol and color properties of event when `CALENDAR_EVENTS` notification is broadcasted from `default/calendar` module.
|
- Add symbol and color properties of event when `CALENDAR_EVENTS` notification is broadcasted from `default/calendar` module.
|
||||||
- Add `.vscode/` folder to `.gitignore` to keep custom Visual Studio Code config out of git
|
- Add `.vscode/` folder to `.gitignore` to keep custom Visual Studio Code config out of git
|
||||||
|
- Add unit test the capitalizeFirstLetter function of newfeed module
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
- Changed 'default.js' - listen on all attached interfaces by default
|
- Changed 'default.js' - listen on all attached interfaces by default
|
||||||
|
@ -14,8 +14,10 @@ describe("Functions into modules/default/calendar/calendar.js", function() {
|
|||||||
Module.definitions[name] = moduleDefinition;
|
Module.definitions[name] = moduleDefinition;
|
||||||
};
|
};
|
||||||
|
|
||||||
// load calendar.js
|
before(function() {
|
||||||
require("../../../modules/default/calendar/calendar.js");
|
// load calendar.js
|
||||||
|
require("../../../modules/default/calendar/calendar.js");
|
||||||
|
});
|
||||||
|
|
||||||
describe("capFirst", function() {
|
describe("capFirst", function() {
|
||||||
words = {
|
words = {
|
||||||
|
37
tests/unit/functions/newsfeed_spec.js
Normal file
37
tests/unit/functions/newsfeed_spec.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
var fs = require("fs");
|
||||||
|
var path = require("path");
|
||||||
|
var chai = require("chai");
|
||||||
|
var expect = chai.expect;
|
||||||
|
var vm = require("vm");
|
||||||
|
|
||||||
|
|
||||||
|
describe("Functions into modules/default/newsfeed/newsfeed.js", function() {
|
||||||
|
|
||||||
|
Module = {}
|
||||||
|
Module.definitions = {};
|
||||||
|
Module.register = function (name, moduleDefinition) {
|
||||||
|
Module.definitions[name] = moduleDefinition;
|
||||||
|
};
|
||||||
|
|
||||||
|
// load newsfeed.js
|
||||||
|
require("../../../modules/default/newsfeed/newsfeed.js");
|
||||||
|
|
||||||
|
describe("capitalizeFirstLetter", function() {
|
||||||
|
words = {
|
||||||
|
"rodrigo": "Rodrigo",
|
||||||
|
"123m": "123m",
|
||||||
|
"magic mirror": "Magic mirror",
|
||||||
|
",a": ",a",
|
||||||
|
"ñandú": "Ñandú",
|
||||||
|
".!": ".!"
|
||||||
|
};
|
||||||
|
|
||||||
|
Object.keys(words).forEach(word => {
|
||||||
|
it(`for ${word} should return ${words[word]}`, function() {
|
||||||
|
expect(Module.definitions.newsfeed.capitalizeFirstLetter(word)).to.equal(words[word]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user