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

Add unit test for OS version names

This commit is contained in:
Jörg Leis 2019-07-17 14:13:17 +02:00
parent b298e8d866
commit b2b36e6adb

View File

@ -3,6 +3,8 @@ import {
getBrowserAlias, getBrowserAlias,
getFirstMatch, getFirstMatch,
getWindowsVersionName, getWindowsVersionName,
getMacOSVersionName,
getAndroidVersionName,
compareVersions, compareVersions,
} from '../../src/utils'; } from '../../src/utils';
@ -16,6 +18,17 @@ test('getWindowsVersionName', (t) => {
t.is(getWindowsVersionName('XXX'), void 0); t.is(getWindowsVersionName('XXX'), void 0);
}); });
test('getMacOSVersionName', (t) => {
t.is(getMacOSVersionName('10.14.5'), 'Mojave');
t.is(getMacOSVersionName('XXX'), void 0);
});
test('getAndroidVersionName', (t) => {
t.is(getAndroidVersionName('8.0'), 'Oreo');
t.is(getAndroidVersionName('9'), 'Pie');
t.is(getWindowsVersionName('XXX'), void 0);
});
test('compareVersions', (t) => { test('compareVersions', (t) => {
const comparisionsTasks = [ const comparisionsTasks = [
['9.0', '10', -1], ['9.0', '10', -1],