2.1.0 • Published 7 years ago
komondor-test v2.1.0
komondor-test
Test library for writing plugins for komondor
.
API
testTrio()
, testLive()
, testSave()
, testSimulate()
has the same signature.
This allows you to easily switch between them to debug specific issue. e.g.
// starts with
testLive('...', (title, spec) => {
test.only(title, async () => {
// test away
})
})
// change 4 characters 'Live' to 'Save' for saving the result
testSave('...', ...)
// change `Save` to `Simulate` to valid it works in simulate mode
testSimulate('...', ...)
// change to `Trio` to run all three
testTrio('...', ...)
testTrio(customDescription, specName, handler)
Use testTrio()
to run all three tests (live
, save
, and simulate
)
import { testTrio } from 'komondor-test'
testTrio('node/childProcess/success', (title, spec) => {
// `test()` is your test runner: jest, ava, mocha, etc.
test(title, async () => {
const s = await spec(childProcess)
...
})
})
testLive(customDescription, specName, handler)
Use testLive()
to run spec in live mode.
import { testLive } from 'komondor-test'
testLive('node/childProcess/success', (title, spec) => {
// `test()` is your test runner: jest, ava, mocha, etc.
test(title, async () => {
const s = await spec(childProcess)
...
})
})
testSave(customDescription, specName, handler)
Use testSave()
to run spec in save mode
import { testSave } from 'komondor-test'
testSave('node/childProcess/success', (title, spec) => {
// `test()` is your test runner: jest, ava, mocha, etc.
test(title, async () => {
const s = await spec(childProcess)
...
})
})
testSimulate(customDescription, specName, handler)
Use testSimulate()
to run spec in simulate mode.
import { testSimulate } from 'komondor-test'
testSimulate('node/childProcess/success', (title, spec) => {
// `test()` is your test runner: jest, ava, mocha, etc.
test(title, async () => {
const s = await spec(childProcess)
...
})
})
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