You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lancedikson_bowser/test/unit/utils.js

16 lines
398 B

7 years ago
import test from 'ava';
import {
getFirstMatch,
getWindowsVersionName,
} from '../../src/utils';
7 years ago
6 years ago
test('getFirstMatch', (t) => {
7 years ago
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);
});