mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-10-01 01:37:43 +03:00
Fix #718 - Extension param now accept multiple extensions
This commit is contained in:
@@ -34,6 +34,12 @@ describe('Bots', () => {
|
||||
assert.deepEqual(botsAndCLIsParser.setUA(wget).getBrowser(), {name: "Wget", version: "1.21.1", major: "1", type:"cli"});
|
||||
assert.deepEqual(botsAndCLIsParser.setUA(facebookBot).getBrowser(), {name: "FacebookBot", version: "1.0", major: "1", type:"bot"});
|
||||
|
||||
// alternative merge options
|
||||
const botsAndCLIsParser2 = new UAParser([Bots, CLIs]);
|
||||
const botsAndCLIsParser3 = new UAParser(facebookBot, [Bots, CLIs]);
|
||||
assert.deepEqual(botsAndCLIsParser2.setUA(wget).getBrowser(), {name: "Wget", version: "1.21.1", major: "1", type:"cli"});
|
||||
assert.deepEqual(botsAndCLIsParser3.getBrowser(), {name: "FacebookBot", version: "1.0", major: "1", type:"bot"});
|
||||
|
||||
const emailParser = new UAParser(Emails);
|
||||
assert.deepEqual(emailParser.setUA(outlook).getBrowser(), {name: "Microsoft Outlook", version: "16.0.9126", major: "16", type: "email"});
|
||||
assert.deepEqual(emailParser.setUA(thunderbird).getBrowser(), {name: "Thunderbird", version: "78.13.0", major: "78", type: "email"});
|
||||
|
@@ -126,6 +126,13 @@ describe('Extending Regex', function () {
|
||||
});
|
||||
let myUA2 = 'Mozilla/5.0 MyTab 14 Pro Max';
|
||||
assert.deepEqual(myParser2.setUA(myUA2).getDevice(), {vendor: "MyTab", model: "14 Pro Max", type: "tablet"});
|
||||
|
||||
let myParser3 = new UAParser([{
|
||||
browser: myOwnListOfBrowsers
|
||||
}, {
|
||||
device: myOwnListOfDevices
|
||||
}]);
|
||||
assert.deepEqual(myParser3.setUA(myUA2).getDevice(), {vendor: "MyTab", model: "14 Pro Max", type: "tablet"});
|
||||
});
|
||||
|
||||
describe('User-agent length', function () {
|
||||
|
Reference in New Issue
Block a user