1.5.16 • Published 7 months ago
@iabtechlabtcf/testing v1.5.16
@iabtechlabtcf/testing
Testing tools to generate randomized input/output
Installation
npm
npm install @iabtechlabtcf/testing --save-devyarn
yarn add -D @iabtechlabtcf/testingUtilities
Generate random TCModel with GVL
import {TCModelFactory} from '@iabtechlabtcf/testing';
const tcModel = TCModelFactory.withGVL();Generate random TC string
import {TCString} from '@iabtechlabtcf/core';
import {TCModelFactory} from '@iabtechlabtcf/testing';
console.log(TCString.encode(TCModelFactory.noGVL()));
// ... random tc stringAdd publisher restrictions
import {TCModelFactory} from '@iabtechlabtcf/testing';
let tcModel = TCModelFactory.withGVL();
tcModel = TCModelFactory.addPublisherRestrictions(tcModel);
// now has random publisher restrictionsGet latest GVL
import {GVLFactory} from '@iabtechlabtcf/testing';
import {GVL} from '@iabtechlabtcf/core';
const gvl = GVLFactory.getLatest();Get version of GVL
import {GVLFactory} from '@iabtechlabtcf/testing';
import {GVL} from '@iabtechlabtcf/core';
const gvl = GVLFactory.getVersion(10);