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:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user