From de4d0989e939380ca5eb3d9e8bce398a7c1fe954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Sun, 26 Mar 2017 00:49:00 -0300 Subject: [PATCH 1/7] Add unit test function capFist calendar module --- tests/unit/functions/calendar_spec.js | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/unit/functions/calendar_spec.js diff --git a/tests/unit/functions/calendar_spec.js b/tests/unit/functions/calendar_spec.js new file mode 100644 index 00000000..435e2e4d --- /dev/null +++ b/tests/unit/functions/calendar_spec.js @@ -0,0 +1,36 @@ +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/calendar/calendar.js", function() { + + // Fake for use by calendar.js + Module = {} + Module.definitions = {}; + Module.register = function (name, moduleDefinition) { + Module.definitions[name] = moduleDefinition; + }; + + // load calendar.js + require("../../../modules/default/calendar/calendar.js"); + + describe("capFirst", 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.calendar.capFirst(word)).to.equal(words[word]); + }); + }); + }); +}); + From c1830aa37c20717a2923b0f581e048f29f3e38d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Tue, 18 Apr 2017 22:21:55 -0300 Subject: [PATCH 2/7] Fix message port starting server --- js/server.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/server.js b/js/server.js index 36ebf740..2fc8dc6f 100644 --- a/js/server.js +++ b/js/server.js @@ -15,14 +15,13 @@ var fs = require("fs"); var helmet = require("helmet"); var Server = function(config, callback) { - console.log("Starting server on port " + config.port + " ... "); var port = config.port; if (process.env.MM_PORT) { port = process.env.MM_PORT; } - console.log("Starting server op port " + port + " ... "); + console.log("Starting server on port " + port + " ... "); server.listen(port, config.address ? config.address : null); From 2b2136867d17eaef4a8c702de67e588d817a8525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Tue, 18 Apr 2017 22:31:16 -0300 Subject: [PATCH 3/7] Add change double message port in starting server --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 675db645..a3ba0bcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Fix instruction in README for using automatically installer script. +- Fix double message about port when server is starting ## [2.1.1] - 2017-04-01 From b41bda569d96a516cf1374509e51ff2ea03070ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Tue, 18 Apr 2017 23:34:14 -0300 Subject: [PATCH 4/7] Change method for check if pass dev parameter --- js/electron.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/electron.js b/js/electron.js index 1f16092b..fbbdba94 100644 --- a/js/electron.js +++ b/js/electron.js @@ -51,7 +51,7 @@ function createWindow() { mainWindow.loadURL("http://localhost:" + config.port); // Open the DevTools if run with "npm start dev" - if(process.argv[2] == "dev") { + if (process.argv.includes("dev")) { mainWindow.webContents.openDevTools(); } From 320ce372f5ca85b3e0c97b5f4eeeaf488c097337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Wed, 19 Apr 2017 00:39:18 -0300 Subject: [PATCH 5/7] Add changelog unit test capFirst function on calendar module --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0816b3e..2dfa5b2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - 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. +- Add unit test calendar_modules function capFirst. ### Updated - Added missing keys to Polish translation. From 4904bd53efaa67c839592f8f1c687691155bc886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Wed, 19 Apr 2017 00:45:55 -0300 Subject: [PATCH 6/7] Fix grunt double quotes unit calendar_spec --- tests/unit/functions/calendar_spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/functions/calendar_spec.js b/tests/unit/functions/calendar_spec.js index 435e2e4d..2c7f62f8 100644 --- a/tests/unit/functions/calendar_spec.js +++ b/tests/unit/functions/calendar_spec.js @@ -19,10 +19,10 @@ describe("Functions into modules/default/calendar/calendar.js", function() { describe("capFirst", function() { words = { - 'rodrigo': 'Rodrigo', - '123m': '123m', - 'magic mirror': 'Magic mirror', - ',a': ',a', + "rodrigo": "Rodrigo", + "123m": "123m", + "magic mirror": "Magic mirror", + ",a": ",a", "ñandú": "Ñandú" }; From 31e63b576b193c618420dfba6339862284523fca Mon Sep 17 00:00:00 2001 From: Johan Eliasson Date: Fri, 21 Apr 2017 23:02:33 +0200 Subject: [PATCH 7/7] Indent and double-quoute --- modules/default/compliments/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/default/compliments/README.md b/modules/default/compliments/README.md index 171c86c0..ca75b475 100644 --- a/modules/default/compliments/README.md +++ b/modules/default/compliments/README.md @@ -88,7 +88,7 @@ config: { ], afternoon: [ "Hello, beauty!", - 'You look sexy!', + "You look sexy!", "Looking good today!" ], evening: [ @@ -110,9 +110,9 @@ around them ("morning", "afternoon", "evening", "snow", "rain", etc.). #### Example compliments.json file: ````json { - "anytime" : [ - "Hey there sexy!" - ], + "anytime" : [ + "Hey there sexy!" + ], "morning" : [ "Good morning, sunshine!", "Who needs coffee when you have your smile?",