Merge branch 'develop' of github.com:faisalman/ua-parser-js into develop

This commit is contained in:
Faisal Salman
2017-10-12 09:19:03 +07:00
5 changed files with 645 additions and 712 deletions

View File

@@ -968,5 +968,15 @@
"version" : "6.5.8.2910",
"major" : "6"
}
},
{
"desc" : "GSA on iOS",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) GSA/30.1.161623614 Mobile/14F89 Safari/602.1",
"expect" :
{
"name" : "GSA",
"version" : "30.1.161623614",
"major" : "30"
}
}
]

File diff suppressed because it is too large Load Diff

View File

@@ -65,6 +65,21 @@ for (var i in methods) {
});
}
describe('Returns', function () {
it('getResult() should returns JSON', function(done) {
assert.deepEqual(new UAParser('').getResult(),
{
ua : '',
browser: { name: undefined, version: undefined, major: undefined },
cpu: { architecture: undefined },
device: { vendor: undefined, model: undefined, type: undefined },
engine: { name: undefined, version: undefined},
os: { name: undefined, version: undefined }
});
done();
});
});
describe('Extending Regex', function () {
var uaString = 'Mozilla/5.0 MyOwnBrowser/1.3';
var myOwnBrowser = [[/(myownbrowser)\/((\d+)?[\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, UAParser.BROWSER.MAJOR]];