mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-30 09:24:26 +03:00
Small refactor
This commit is contained in:
17
test/es6-test.mjs
Normal file
17
test/es6-test.mjs
Normal file
@@ -0,0 +1,17 @@
|
||||
import { UAParser } from '../dist/ua-parser.mjs'
|
||||
import * as assert from 'assert'
|
||||
|
||||
describe('Returns', () => {
|
||||
it('getResult() should returns object', () => {
|
||||
assert.deepEqual(new UAParser('').getResult(),
|
||||
{
|
||||
ua : '',
|
||||
ua_ch : { architecture: undefined, bitness: undefined, brands: undefined, fullVersionList: undefined, mobile: false, model: undefined, platform: undefined, platformVersion: undefined },
|
||||
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 }
|
||||
});
|
||||
});
|
||||
});
|
@@ -195,6 +195,7 @@ describe('is() utility method', function () {
|
||||
assert.strictEqual(uap.getBrowser().name, "IEMobile");
|
||||
assert.strictEqual(uap.getBrowser().is("IEMobile"), true);
|
||||
assert.strictEqual(uap.getBrowser().is("IE"), false);
|
||||
assert.strictEqual(uap.getBrowser().is("11.0"), false);
|
||||
});
|
||||
|
||||
it('Should ignore "Browser" suffix', function () {
|
||||
@@ -204,6 +205,7 @@ describe('is() utility method', function () {
|
||||
it('Should ignore case', function () {
|
||||
assert.strictEqual(uap.getEngine().name, "Trident");
|
||||
assert.strictEqual(uap.getEngine().is("tRiDeNt"), true);
|
||||
assert.strictEqual(uap.getEngine().is("7.0"), false);
|
||||
});
|
||||
|
||||
it('Should get exact name', function () {
|
||||
|
Reference in New Issue
Block a user