mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 21:00:57 +00:00
init tests:
This patch propouse use the mocha for testing MagicMirror.
This commit is contained in:
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);
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user