assert-order
...sometimes we do need to assert code are executed in certain order.
This is the library for that.
Usage
order.once(step: number)
Asserts the step step
executed once.
foofoo // throws
fooboo
order.atLeastOnce(step: number)
Assert step step
have executed at least once.
for ; i < 10; i++ o.atLeastOnce1 o.once2
order.exactly(step: number, times: number)
Asserts the step step
executed exactly n times
for ; i < 4; i++ o.exactly1, 3 // throws at i === 3
order.any(steps: number[])
Asserts any of the steps steps
executed.
for ; i <= 4; i++
There are more methods available. Use TypeScript to discover them!
Contribute
# right after fork npm install # begin making changes git checkout -b <branch>npm run watch # edit `webpack.config.dev.js` to exclude dependencies for the global build. # after making change(s) git commit -m "<commit message>"git push # create PR
Npm Commands
There are a few useful commands you can use during development.
# Run tests (and lint) automatically whenever you save a file. npm run watch # Run tests with coverage stats (but won't fail you if coverage does not meet criteria) npm run test # Manually verify the project. # This will be ran during 'npm preversion' so you normally don't need to run this yourself. npm run verify # Build the project. # You normally don't need to do this. npm run build # Run tslint # You normally don't need to do this as `npm run watch` and `npm version` will automatically run lint for you. npm run lint
Generated by generator-unional@0.0.1