mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
commit
2d8d25808d
@ -19,8 +19,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- Russian Translation
|
||||
- Afrikaans Translation
|
||||
- Add postinstall script to notify user that MagicMirror installed successfully despite warnings from NPM.
|
||||
- Init tests using mocha.
|
||||
- Option to use RegExp in Calendar's titleReplace.
|
||||
|
||||
|
||||
### Fixed
|
||||
- Update .gitignore to not ignore default modules folder.
|
||||
- Remove white flash on boot up.
|
||||
|
@ -415,3 +415,7 @@ Module.register = function (name, moduleDefinition) {
|
||||
Log.log("Module registered: " + name);
|
||||
Module.definitions[name] = moduleDefinition;
|
||||
};
|
||||
|
||||
exports._test = {
|
||||
cmpVersions: cmpVersions
|
||||
}
|
||||
|
@ -5,7 +5,8 @@
|
||||
"main": "js/electron.js",
|
||||
"scripts": {
|
||||
"start": "electron js/electron.js",
|
||||
"postinstall": "sh installers/postinstall/postinstall.sh"
|
||||
"postinstall": "sh installers/postinstall/postinstall.sh",
|
||||
"test": "./node_modules/mocha/bin/mocha tests --recursive"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -27,12 +28,14 @@
|
||||
},
|
||||
"homepage": "https://github.com/MichMich/MagicMirror#readme",
|
||||
"devDependencies": {
|
||||
"chai": "^3.5.0",
|
||||
"grunt": "latest",
|
||||
"grunt-eslint": "latest",
|
||||
"grunt-jsonlint": "latest",
|
||||
"grunt-markdownlint": "^1.0.13",
|
||||
"grunt-stylelint": "latest",
|
||||
"grunt-yamllint": "latest",
|
||||
"mocha": "^3.2.0",
|
||||
"stylelint-config-standard": "latest",
|
||||
"time-grunt": "latest"
|
||||
},
|
||||
|
21
tests/functions/compare-version.js
Normal file
21
tests/functions/compare-version.js
Normal file
@ -0,0 +1,21 @@
|
||||
var chai = require('chai');
|
||||
var expect = chai.expect;
|
||||
var classMM = require('../../js/class.js'); // require for load module.js
|
||||
var moduleMM = require('../../js/module.js')
|
||||
|
||||
describe('Test function cmpVersions into js/module.js', function() {
|
||||
|
||||
it('Should be return -1 ', function() {
|
||||
expect(moduleMM._test.cmpVersions('2.1', '2.2')).to.equal(-1);
|
||||
});
|
||||
|
||||
it('Should be return 0 ', function() {
|
||||
expect(moduleMM._test.cmpVersions('2.2', '2.2')).to.equal(0);
|
||||
});
|
||||
|
||||
it('Should be return 1', function() {
|
||||
expect(moduleMM._test.cmpVersions('1.1', '1.0')).to.equal(1);
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user