Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leobalter/stdout-reporter
A tests stdout reporter
https://github.com/leobalter/stdout-reporter
Last synced: about 2 months ago
JSON representation
A tests stdout reporter
- Host: GitHub
- URL: https://github.com/leobalter/stdout-reporter
- Owner: leobalter
- License: other
- Created: 2015-04-10T19:46:09.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-10T21:20:10.000Z (almost 10 years ago)
- Last Synced: 2024-04-26T10:03:29.396Z (9 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# stdout-reporter
A tool to report test results on node's stdout.
[![Build Status](https://travis-ci.org/leobalter/stdout-reporter.svg)](https://travis-ci.org/leobalter/stdout-reporter)
## Install
```
npm install --save-dev stdout-reporter
```## Usage
```js
var Reporter = require( "stdout-reporter" );
var reporter = new Reporter( [ options ] );/* and then you set your logging methods */
...
```### Logging Methods
- `moduleStart`: register a module start
- requires a details object as the argument with the following properties:
- `name`: the module's name
- `testStart`: register a test start
- requires a details object as the argument with the following properties:
- `name`: the test's name
- `assertion`: register an assertion execution
- requires a details object as the argument with the following properties:
- `module`: a string with the module's name
- `name`: a string with the test's name
- `result` a Boolean value for the result (`true` if passed)
- `message`: a string with the assertion's message
- `source`: [optional] a string with the the stacktrace information
- `actual`: the assertion given value to be compared with the expected object
- `expected`: the expected value
- `testDone`: register a test ending
- requires a details object as the argument with the following properties:
- `failed`: a number with the failed assertions in the test
- `runtime`: a number representing the runtime in ms
- `done`: register a run ending
- requires a details object as the argument with the following properties:
- `total`: a number with the total assertions
- `failed`: a number with the failed assertions
- `passed`: a number with the passed assertions
- `runtime`: a number representing the runtime in ms### Options
This module can be instatiated with an options object as its argument.
- `output`: none (default), `"minimal"` or `"verbose"`
- with no given value, the default output will list the modules and test names, followed by dots representing each passing assertion.
- `minimal` will omit the modules and tests names on the output.
- `verbose` will print a more detailed output.