mirror of
https://github.com/lancedikson/bowser
synced 2026-03-02 03:40:27 +00:00
Updates
This commit is contained in:
21
test/acceptance/test-list-of-ua.js
Normal file
21
test/acceptance/test-list-of-ua.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import test from 'ava';
|
||||
import yaml from 'yamljs';
|
||||
import path from 'path';
|
||||
import Bowser from '../../src/bowser';
|
||||
import BowserBuild from '../../es5';
|
||||
|
||||
const listOfUA = yaml.load(path.join(__dirname, 'useragentstrings.yml'));
|
||||
|
||||
const browserNames = Object.keys(listOfUA);
|
||||
|
||||
browserNames.forEach((browserName) => {
|
||||
listOfUA[browserName].forEach((browser, index) => {
|
||||
test(`Test ${browserName} ${index}`, (t) => {
|
||||
const parsed = Bowser.parse(browser.ua);
|
||||
const parsedBuild = BowserBuild.parse(browser.ua);
|
||||
t.deepEqual(parsed, browser.spec, `${browser.ua}`);
|
||||
t.deepEqual(parsedBuild, browser.spec, `${browser.ua}`);
|
||||
t.is(parsed.browser.name, browserName, `${browser.ua}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
2611
test/acceptance/useragentstrings.yml
Normal file
2611
test/acceptance/useragentstrings.yml
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user