1
0
mirror of https://github.com/lancedikson/bowser synced 2026-03-02 03:40:27 +00:00

Adds loose comparison support

This commit is contained in:
udivankin
2018-08-16 19:04:10 +03:00
committed by udi
parent 42b4c8cfa3
commit 6204d9f417
5 changed files with 44 additions and 15 deletions

View File

@@ -57,8 +57,13 @@ test('Skip parsing shouldn\'t parse', (t) => {
t.deepEqual((new Parser(UA, true)).getResult(), {});
});
test('Parser.check should make simple comparison', (t) => {
test('Parser.check should make simple comparisons', (t) => {
// also covers Parser.compareVersion() method
t.is(parser.satisfies({ opera: '>42' }), true);
t.is(parser.satisfies({ opera: '<44' }), true);
t.is(parser.satisfies({ opera: '=43.0.2442.1165' }), true);
t.is(parser.satisfies({ opera: '~43.0' }), true);
t.is(parser.satisfies({ opera: '~43' }), true);
});
test('Parser.check should make complex comparison', (t) => {