mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-30 17:27:44 +03:00
[submodule:helpers] Enable directly pass user-agent as an input to isAppleSilicon()
/ isBot()
/ isChromeFamily()
This commit is contained in:
@@ -28,7 +28,9 @@ describe('isAppleSilicon', () => {
|
||||
const macIntel = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0';
|
||||
|
||||
assert.equal(isAppleSilicon(UAParser(macIntel)), false);
|
||||
assert.equal(isAppleSilicon(macIntel), false);
|
||||
assert.equal(isAppleSilicon(UAParser(macARM)), true);
|
||||
assert.equal(isAppleSilicon(macARM), true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -46,6 +48,11 @@ describe('isBot', () => {
|
||||
assert.equal(isBot(botParser.setUA(ahrefsBot).getResult()), true);
|
||||
assert.equal(isBot(botParser.setUA(scrapy).getResult()), true);
|
||||
assert.equal(isBot(botParser.setUA(thunderbird).getResult()), false);
|
||||
|
||||
assert.equal(isBot(ahrefsBot), true);
|
||||
assert.equal(isBot(firefox), false);
|
||||
assert.equal(isBot(scrapy), true);
|
||||
assert.equal(isBot(thunderbird), false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -57,5 +64,7 @@ describe('isChromeFamily', () => {
|
||||
|
||||
assert.equal(isChromeFamily(UAParser(edge)), true);
|
||||
assert.equal(isChromeFamily(UAParser(firefox)), false);
|
||||
assert.equal(isChromeFamily(edge), true);
|
||||
assert.equal(isChromeFamily(firefox), false);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user