diff --git a/src/parser-engines.js b/src/parser-engines.js index 7102c5f..1316eb9 100644 --- a/src/parser-engines.js +++ b/src/parser-engines.js @@ -1,6 +1,4 @@ -import { - getFirstMatch, -} from './utils'; +import { getFirstMatch } from './utils'; /* * More specific goes first diff --git a/src/parser-os.js b/src/parser-os.js index 82e4e4f..fecbb2b 100644 --- a/src/parser-os.js +++ b/src/parser-os.js @@ -1,6 +1,4 @@ -import { - getFirstMatch, -} from './utils'; +import { getFirstMatch } from './utils'; function getWindowsVersionName(version) { switch (version) { diff --git a/src/parser-platforms.js b/src/parser-platforms.js index 8a4bd53..9a203eb 100644 --- a/src/parser-platforms.js +++ b/src/parser-platforms.js @@ -1,6 +1,4 @@ -import { - getFirstMatch, -} from './utils'; +import { getFirstMatch } from './utils'; const TYPES_LABELS = { tablet: 'tablet', diff --git a/test/acceptance/test-list-of-ua.js b/test/acceptance/test-list-of-ua.js index fc172ca..b386e40 100644 --- a/test/acceptance/test-list-of-ua.js +++ b/test/acceptance/test-list-of-ua.js @@ -5,7 +5,9 @@ import Bowser from '../../src/bowser'; const listOfUA = yaml.load(path.join(__dirname, 'useragentstrings.yml')); -for (const browserName in listOfUA) { +const browserNames = Object.keys(listOfUA); + +browserNames.forEach((browserName) => { listOfUA[browserName].forEach((browser) => { test('Check all the test browsers', (t) => { const parsed = new Bowser(browser.ua).parse().getResult(); @@ -13,4 +15,4 @@ for (const browserName in listOfUA) { t.is(parsed.browser.name, browserName, `${browser.ua}`); }); }); -} +}); diff --git a/test/unit/parser.js b/test/unit/parser.js index 62e960d..a25de73 100644 --- a/test/unit/parser.js +++ b/test/unit/parser.js @@ -5,19 +5,19 @@ import Parser from '../../src/parser'; const UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 OPR/43.0.2442.1165'; const parser = new Parser(UA); -test('constructor', t => { +test('constructor', (t) => { t.truthy(parser instanceof Parser); }); -test('Parser.getUA returns a correct UA', t => { +test('Parser.getUA returns a correct UA', (t) => { t.is(parser.getUA(), UA); }); -test('Parser.test', t => { +test('Parser.test', (t) => { t.truthy(parser.test(/Chrome/i)); }); -test('Parser._parseBrowser is being called when the Parser.getBrowser() is called', t => { +test('Parser._parseBrowser is being called when the Parser.getBrowser() is called', (t) => { const spy = sinon.spy(parser, '_parseBrowser'); const b = parser.getBrowser(); t.truthy(spy.called); @@ -26,29 +26,29 @@ test('Parser._parseBrowser is being called when the Parser.getBrowser() is calle parser._parseBrowser.restore(); }); -test('Parser.getBrowserName returns a correct result', t => { +test('Parser.getBrowserName returns a correct result', (t) => { t.is(parser.getBrowserName(), 'Opera'); }); -test('Parser.getBrowserVersion returns a correct result', t => { +test('Parser.getBrowserVersion returns a correct result', (t) => { t.is(parser.getBrowserVersion(), '43.0.2442.1165'); }); -test('Parser._parseOS is being called when getOS() called', t => { +test('Parser._parseOS is being called when getOS() called', (t) => { const spy = sinon.spy(parser, '_parseOS'); parser.getOS(); t.truthy(spy.called); parser._parseOS.restore(); }); -test('Parser.getOSName gives a name of the browser', t => { +test('Parser.getOSName gives a name of the browser', (t) => { t.is(parser.getOSName(), 'macOS'); }); -test('Parser.getOSName gives a lower-cased name of the browser', t => { +test('Parser.getOSName gives a lower-cased name of the browser', (t) => { t.is(parser.getOSName(true), 'macos'); }); -test('Parser.getOSVersion returns a correct result', t => { +test('Parser.getOSVersion returns a correct result', (t) => { t.is(parser.getOSVersion(), '10.12.4'); }); diff --git a/test/unit/utils.js b/test/unit/utils.js index d55b613..eab8415 100644 --- a/test/unit/utils.js +++ b/test/unit/utils.js @@ -1,7 +1,7 @@ import test from 'ava'; import { getFirstMatch } from '../../src/utils'; -test('getFirstMatch', t => { +test('getFirstMatch', (t) => { const matchedVersion = getFirstMatch(/version\/(\S+)/i, 'Chrome Version/11.11.11'); t.is(matchedVersion, '11.11.11'); });