Comparing version 0.5.2 to 0.5.3
@@ -5,2 +5,3 @@ var isAndroid = require('../is_android') | ||
var isMac = require('../is_mac') | ||
var isLinux = require('../is_linux') | ||
var isWindows = require('../is_windows') | ||
@@ -18,2 +19,4 @@ var isWindowsPhone = require('../is_windows_phone') | ||
return 'windows mobile' | ||
} else if (isLinux(str)) { | ||
return 'linux' | ||
} else if (isMac(str)) { | ||
@@ -20,0 +23,0 @@ return 'mac' |
@@ -74,4 +74,14 @@ const test = require('ava') | ||
test('whichOS detects "linux"', (t) => { | ||
;[ | ||
'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0', | ||
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.32 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.32 Epiphany/3.8.2', | ||
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1636.0 Safari/537.36' | ||
].forEach((ua) => { | ||
t.is(whichOS(ua), 'linux') | ||
}) | ||
}) | ||
test("whichOS returns if OS can't be detected", (t) => { | ||
t.is(whichOS('wutOS'), undefined) | ||
}) |
{ | ||
"name": "sniff-fns", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"author": "Ivan Shornikov <paraboom@gmail.com>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
51834
853