spooning-cli v1.0.6
spooning-cli
Run tests defined with spooning.
Sample Output
Install
npm install -D spooning spooning-cliRequires node 6 or later. spooning-cli requires spooning as a peer dependency.
Usage
spoon [options] './test/**/*.test.js'
--bail # exit after first test failure
--concurrency|-c N # run tests in parallel, limit N (default: 1)
--debug # include stack trace in error output
--no-style # force plain styleCommand Example
spoon --debug -c 10 './test/**/*.test.js'If using glob features like ** (aka globstar), remember to put the pattern in quotes.
Specify multiple patterns to include files matched by any pattern.
Colors are enabled automatically if the environment supports them unless the --no-style flag is specified.
Test Definition Examples
Test definition files may call require('spooning') and define tests in their root scope
or export a synchronous function that accepts a spooning parameter and defines tests when run.
const {it} = require('spooning');
it('Should pass', (callback) => {
callback();
});
it('Should fail', (callback) => {
callback(new Error('failed'));
});or
module.exports = ({it}) => {
it('Should pass', (callback) => {
callback();
});
it('Should fail', (callback) => {
callback(new Error('failed'));
});
};Note: If spooning-cli is installed globally (not recommended) test definition files MUST export a function and use the spooning instance passed to the function. If spooning-cli is installed as a project dependency, tests may export a function but it is optional.
Development
Clone the repository and run npm install in the project root.
Run Tests
npm testThe test script accepts the same arguments as the spoon command.
npm test -- --debugGenerate Coverage Reports
npm run coverOccasionally, the text based report will show values less than 100% but not identify any offending line numbers.
Use the npm run cover-html command to output a more detailed html-based coverage report to the
.coverage directory.
Built With
Dependencies
- glob — match files by glob pattern
- minimist — parse command line arguments
- supports-color — determine if colors are supported by the environment
Dev Dependencies
Contributing
Fork the repo and submit a pull request. Contributions must have 100% test coverage and adhere to the code style enforced by eslint.
Versioning
SemVer is used for versioning. For the versions available, see the tags on this repository.
Releasing
Examine what will be included in the npm bundle:
npm run packThe
npm run packcommand requires npm version 6.4.1 or later (because it uses the--dry-runflag). For older versions of npm, runtar -tvf "$(npm pack)"to list the contents of the generated tarball.Bump the version number in package.json and create a git tag:
npm version patchThe
npm versioncommand accepts a SemVer argument:<newversion>|major|minor|patch(where<newversion>is a standard version number, ex. 1.0.0).Publish a new version:
npm publish git push origin master --tags
Author
License
This project is licensed under the MIT License. See the LICENSE.txt file for details.