Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

rsv

1.0.2 • Public • Published

npm version

Sample values, not simple value.

sample-value returns a value randomly from given values.

Usage

Good for build strong test including eventually invalid values.

npm install rsv

// ONLY the example using es6 syntax.
 
const should_fail = require('rsv')(null, '', 'INVALID', false)
// returns null OR '' OR 'INVALID' OR false
 
const users = [
  {age: 26},
  {age: 19},
  {age: 32},
  {age: 43},
  {age: 113},
  {age: -1},
]
const user = require('rsv')(...users)
// returns any object from users array.

Test

npm test

Useful examples at test.js.

Install

npm i rsv

DownloadsWeekly Downloads

3

Version

1.0.2

License

MIT

Last publish

Collaborators

  • avatar