mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
17 lines
527 B
JavaScript
17 lines
527 B
JavaScript
import test from 'ava';
|
|
import yaml from 'yamljs';
|
|
import path from 'path';
|
|
import Bowser from '../../src/bowser';
|
|
|
|
const listOfUA = yaml.load(path.join(__dirname, 'useragentstrings.yml'));
|
|
|
|
for (const browserName in listOfUA) {
|
|
listOfUA[browserName].forEach((browser) => {
|
|
test('Check all the test browsers', (t) => {
|
|
const parsed = new Bowser(browser.ua).parse().getResult();
|
|
t.deepEqual(parsed, browser.spec, `${browser.ua}`);
|
|
t.is(parsed.browser.name, browserName, `${browser.ua}`);
|
|
});
|
|
});
|
|
}
|