first commit

This commit is contained in:
2025-09-16 01:40:08 +03:00
commit d9969e1394
252 changed files with 41184 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
'use strict';
const chai = require('chai');
const mixitup = require('../../dist/mixitup.js');
const h = mixitup.h;
describe('h#compareVersions()', () => {
it('should return true if versions are matching', () => {
let result = h.compareVersions('1.0.0', '1.0.0');
chai.assert.isOk(result);
});
it('should return false if specimen version is less than control', () => {
let result = h.compareVersions('1.0.0', '0.1.2');
chai.assert.isNotOk(result);
});
it('should return true if specimen version is greater than control', () => {
let result = h.compareVersions('1.0.0', '1.1.2');
chai.assert.isOk(result);
});
it('should return true if specimen version is greater than control, with double figures', () => {
let result = h.compareVersions('3.0.0', '10.1.2');
chai.assert.isOk(result);
});
it('should handle semver carat notation', () => {
let result = h.compareVersions('^3.0.0', '2.0.0');
chai.assert.isNotOk(result);
});
it('should handle semver label notation', () => {
let result = h.compareVersions('^3.0.0', '3.0.0-beta');
chai.assert.isOk(result);
});
});