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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user