mirror of
https://github.com/lancedikson/bowser
synced 2026-03-02 03:40:27 +00:00
Setup acceptance tests with list of UAs
This commit is contained in:
16
test/acceptance/test-list-of-ua.js
Normal file
16
test/acceptance/test-list-of-ua.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import test from 'ava';
|
||||
import yaml from 'yamljs';
|
||||
import path from 'path';
|
||||
import Bowser from '../../src/new-bowser';
|
||||
|
||||
const listOfUA = yaml.load(path.join(__dirname, 'useragentstrings.yml'));
|
||||
|
||||
test('Check all the test browsers', t => {
|
||||
for (const browserName in listOfUA) {
|
||||
listOfUA[browserName].forEach((browser) => {
|
||||
const parsed = new Bowser(browser.ua).parse().getResult();
|
||||
t.deepEqual(parsed, browser.spec, `${browser.ua}`);
|
||||
t.is(parsed.browser.name, browserName, `${browser.ua}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
2320
test/acceptance/useragentstrings.yml
Normal file
2320
test/acceptance/useragentstrings.yml
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user