1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00
lancedikson_bowser/test/unit/constants.js

16 lines
479 B
JavaScript
Raw Permalink Normal View History

2019-02-26 02:23:55 +00:00
import test from 'ava';
import { BROWSER_ALIASES_MAP } from '../../src/constants';
test('check duplicate aliases', (t) => {
const aliasesList = Object.keys(BROWSER_ALIASES_MAP).map(value => (BROWSER_ALIASES_MAP[value]));
let foundOnce, foundTwice;
const duplicates = aliasesList.filter(item => {
foundOnce = aliasesList.indexOf(item);
foundTwice = aliasesList.indexOf(item, foundOnce + 1);
return +foundTwice !== -1;
});
t.deepEqual(duplicates, []);
});