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

Rename Parser.compare to Parser.satisfies

This commit is contained in:
Denis Demchenko
2018-07-07 18:35:18 +03:00
parent c79b71736e
commit a175f7c8bd
3 changed files with 15 additions and 152 deletions

View File

@@ -58,11 +58,11 @@ test('Skip parsing shouldn\'t parse', (t) => {
});
test('Parser.check should make simple comparison', (t) => {
t.is(parser.compare({ opera: '>42' }), true);
t.is(parser.satisfies({ opera: '>42' }), true);
});
test('Parser.check should make complex comparison', (t) => {
t.is(parser.compare({
t.is(parser.satisfies({
macos: {
safari: '>11',
},
@@ -73,6 +73,15 @@ test('Parser.check should make complex comparison', (t) => {
}), true);
});
test('Parser.check should respect platform and OS specific declarations', (t) => {
t.is(parser.satisfies({
macos: {
safari: '>45',
},
opera: '>42',
}), false);
});
test('Parser.is should pass', (t) => {
t.is(parser.is('opera'), true);
t.is(parser.is('desktop'), true);