1
0
mirror of https://github.com/lancedikson/bowser synced 2026-03-02 03:40:27 +00:00

Move getWindowsVersionName to utils

This commit is contained in:
Denis Demchenko
2018-06-30 19:40:10 +03:00
parent 3530ca1c70
commit 9cb04fcbae
3 changed files with 29 additions and 18 deletions

View File

@@ -1,7 +1,15 @@
import test from 'ava';
import { getFirstMatch } from '../../src/utils';
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);
});