@cookiehub/iabtcf-testing
v1.5.20
Published
Shared testing utilities
Downloads
18
Maintainers
Readme
@cookiehub/iabtcf-testing
Testing tools to generate randomized input/output
Installation
npm
npm install @cookiehub/iabtcf-testing --save-devyarn
yarn add -D @cookiehub/iabtcf-testingUtilities
Generate random TCModel with GVL
import {TCModelFactory} from '@cookiehub/iabtcf-testing';
const tcModel = TCModelFactory.withGVL();
Generate random TC string
import {TCString} from '@cookiehub/iabtcf-core';
import {TCModelFactory} from '@cookiehub/iabtcf-testing';
console.log(TCString.encode(TCModelFactory.noGVL()));
// ... random tc string
Add publisher restrictions
import {TCModelFactory} from '@cookiehub/iabtcf-testing';
let tcModel = TCModelFactory.withGVL();
tcModel = TCModelFactory.addPublisherRestrictions(tcModel);
// now has random publisher restrictions
Get latest GVL
import {GVLFactory} from '@cookiehub/iabtcf-testing';
import {GVL} from '@cookiehub/iabtcf-core';
const gvl = GVLFactory.getLatest();
Get version of GVL
import {GVLFactory} from '@cookiehub/iabtcf-testing';
import {GVL} from '@cookiehub/iabtcf-core';
const gvl = GVLFactory.getVersion(10);
