1
0
mirror of https://github.com/lancedikson/bowser synced 2024-09-28 06:10:45 +00:00
lancedikson_bowser/test/unit/utils.js
2018-06-30 19:40:10 +03:00

16 lines
398 B
JavaScript

import test from 'ava';
import {
getFirstMatch,
getWindowsVersionName,
} from '../../src/utils';
test('getFirstMatch', (t) => {
const matchedVersion = getFirstMatch(/version\/(\S+)/i, 'Chrome Version/11.11.11');
t.is(matchedVersion, '11.11.11');
});
test('getWindowsVersionName', (t) => {
t.is(getWindowsVersionName('NT 5.0'), '2000');
t.is(getWindowsVersionName('XXX'), void 0);
});