JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q67785F
  • License Apache-2.0

Shared testing utilities

Package Exports

    Readme

    NPM version npm module downloads per month InteractiveAdvertisingBureau

    @pubtech-ai/testing

    Testing tools to generate randomized input/output

    Installation

    npm

    npm install @pubtech-ai/testing --save-dev

    yarn

    yarn add -D @pubtech-ai/testing

    Utilities

    TCModelFactory

    Generate random TCModel with GVL

    import {TCModelFactory} from '@pubtech-ai/testing';
    
    const tcModel = TCModelFactory.withGVL();
    

    Generate random TC string

    import {TCString} from '@pubtech-ai/core';
    import {TCModelFactory} from '@pubtech-ai/testing';
    
    console.log(TCString.encode(TCModelFactory.noGVL()));
    // ... random tc string
    

    Add publisher restrictions

    import {TCModelFactory} from '@pubtech-ai/testing';
    let tcModel = TCModelFactory.withGVL();
    tcModel = TCModelFactory.addPublisherRestrictions(tcModel);
    // now has random publisher restrictions
    

    GVLFactory

    Get latest GVL

    import {GVLFactory} from '@pubtech-ai/testing';
    import {GVL} from '@pubtech-ai/core';
    
    const gvl = GVLFactory.getLatest();
    

    Get version of GVL

    import {GVLFactory} from '@pubtech-ai/testing';
    import {GVL} from '@pubtech-ai/core';
    
    const gvl = GVLFactory.getVersion(10);