@nbottarini/test-examples
v0.1.0
Published
Simple javascript/typescript utility class to generate test examples
Downloads
171
Maintainers
Readme
Test Examples
Simple javascript/typescript utility class to generate test examples
Installation
Npm:
$ npm install --save @nbottarini/test-examples
Yarn:
$ yarn add @nbottarini/test-examples
Usage
const names = new TestExamples(['alice', 'bob', 'charlie'])
names.one() // returns 'alice'
names.one() // returns 'bob'
names.one() // returns 'charlie'
names.one() // returns 'alice'
const phones = TestExamples.build(3, (number) => new Phone(`111-454${number}`))
phones.one() // returns Phone('111-4540')
phones.one() // returns Phone('111-4541')
phones.one() // returns Phone('111-4542')
phones.one() // returns Phone('111-4540')