Add new method: withClientHints() #408 #566 #588

This commit is contained in:
Faisal Salman
2023-03-11 02:08:15 +07:00
parent 5672a2e15c
commit aff5a209f8
3 changed files with 239 additions and 146 deletions

View File

@@ -82,7 +82,7 @@ describe('Returns', function () {
assert.deepEqual(new UAParser('').getResult(),
{
ua : '',
ua_ch : { architecture: undefined, bitness: undefined, brands: undefined, mobile: false, model: undefined, platform: undefined, platformVersion: undefined },
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 },
@@ -400,4 +400,12 @@ describe('Map UA-CH headers', function () {
assert.strictEqual(os.name, "Linux");
assert.strictEqual(os.version, "x86_64");
});
});
describe('Map UA-CH JS', function () {
it('Can read client hints from browser', async function () {
let ua = new UAParser();
let browser = await ua.getBrowser().withClientHints();
// TODO : create tests
});
});