1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Add tests for a browser without an alias

This commit is contained in:
Denis Demchenko 2019-04-12 21:35:17 +03:00
parent 4b658441ca
commit 8212e48e02

View File

@ -8,6 +8,9 @@ const parser = new Parser(UA, true);
const EDGE_UA = 'Mozilla/5.0 (Linux; Android 8.0; Pixel XL Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.0 Mobile Safari/537.36 EdgA/41.1.35.1'; const EDGE_UA = 'Mozilla/5.0 (Linux; Android 8.0; Pixel XL Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.0 Mobile Safari/537.36 EdgA/41.1.35.1';
const edgeParser = new Parser(EDGE_UA, true); const edgeParser = new Parser(EDGE_UA, true);
const FOCUS_UA = 'Mozilla/5.0 (Linux; Android 7.1.1) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/1.2.1 Chrome/59.0.3071.125';
const focusParser = new Parser(FOCUS_UA, true);
test('constructor', (t) => { test('constructor', (t) => {
t.truthy(parser instanceof Parser); t.truthy(parser instanceof Parser);
}); });
@ -184,3 +187,8 @@ test('Parser.isBrowser should pass when loosely checking', (t) => {
t.is(edgeParser.isBrowser('edge', true), true); t.is(edgeParser.isBrowser('edge', true), true);
t.is(edgeParser.isBrowser('Edge', true), true); t.is(edgeParser.isBrowser('Edge', true), true);
}); });
test('Parser.isBrowser should pass for non-aliased browsers', (t) => {
t.is(focusParser.isBrowser('Focus', true), true);
t.is(focusParser.isBrowser('Focus', false), true);
});