1
0
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:
Denis Demchenko
2017-08-20 18:21:17 +03:00
parent 99fde0a154
commit 076ee810bd
3 changed files with 115 additions and 98 deletions

View 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}`);
});
}
});

File diff suppressed because it is too large Load Diff