2017-03-26 16:19:45 -03:00
|
|
|
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 = {
|
2017-07-20 00:27:57 -04:00
|
|
|
"rodrigo": "Rodrigo",
|
|
|
|
"123m": "123m",
|
|
|
|
"magic mirror": "Magic mirror",
|
|
|
|
",a": ",a",
|
2017-03-26 16:19:45 -03:00
|
|
|
"ñ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]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|