hof-util-testdata

1.0.1 • Public • Published

hof-util-testdata

Generator for test fixtures

Usage

The library contains a number of generators for values of certain types. Values are generators on accessing the type property.

Example:

const TestData = require('hof-util-testdata');
 
console.log(TestData.name);
// "David Fletcher"
 
console.log(TestData.name);
// "Irene O'Grady"

Available generators

  • firstname
  • lastname
  • name
  • email
  • phone
  • streetname
  • streetsuffix
  • address - ${number(1,100)} ${streetname} ${streetsuffix}
  • postcode
  • country - a random country from homeoffice-countries

Functions

  • number(min, max) - returns an integer between min and max
  • number(max) - returns an integer between 0 and max
  • number() - returns an integer between 0 and 100

/hof-util-testdata/

    Package Sidebar

    Install

    npm i hof-util-testdata

    Weekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • temitopeayoku
    • mdev246
    • vinodha.s
    • chisomoguibe
    • robertmccann
    • rhyad-zergane-ho
    • rhodine
    • mohameduwais
    • lennym
    • easternbloc
    • joefitter
    • coupey
    • sulthan-ahmed
    • andrew.moody.ho
    • aswann
    • robertdeniszczyc2
    • agraham19
    • aaron.robinson
    • sarahjaneluff
    • cmedland
    • hof-bot-user