Primitive plugin support.
It will add the supplied `fn to Runner's prototype.
Examples:
Register a single function, could be both middleware or expectation:
joker.register('stdoutNotEqual', fn);
Later on this can be used as you would expect:
new Joker()
.run('ls /tmp')
.stdoutNotEqual('xxx')
.end()
In case you want to register more than one function at once you may want to pass an object:
joker.register({
name: fn,
otherName: fn2,
etc: etc,
});
The second example might come handy when developing plugins. Keep in mind that the plugin system will most certainly change in future version (prior hitting 1.0.0). The current implementation has some obvious problems like what plugin developers will do if they happen to use the same function name. Any ideas and suggestions are more than welcome.
Assert stdout or stderr.
Return an exit code expectation.
Callback generator for middlewares. Throw errors if any.
Create and return a new AssertionError
.
It will assign the given result
to it, it will also prepend the executed command
to the error message.
Assertion error is a constructor for test and validation frameworks that implements standardized Assertion Error specification.
For more info go visit https://github.com/chaijs/assertion-error
Run a command in a shell.
middleware
Verify that a path
exists.
Verify that path
's data matches data
.
Asynchronous mkdir(2).
middleware
Asynchronous rmdir(2).
middleware
Read interactive prompts on a stream and write the associated response to another
Largely borrowed from @jprichardson's module "node-suppose" https://github.com/jprichardson/node-suppose/
Return a stderr expectation.
string or regular express to match
Return a stdout expectation.
string or regular express to match
Return no timeout expectation.
Asynchronous unlink(2).
middleware
Asynchronously writes data to a file, replacing the file if it already exists.
data
can be a string or a buffer.
middleware
Generated using TypeDoc
The type of a function that runs in
Batch