Comparing version 0.0.1 to 0.0.2
@@ -20,3 +20,3 @@ 'use strict'; | ||
* Reports a success for the current test. Parameters: | ||
* - message (optional): the message to show. Default: '.'. | ||
* - message (optional): the message to show. Default: true. | ||
* - callback (optional): function to call. If not present, just show the message. | ||
@@ -29,3 +29,3 @@ * The function must be in node.js style: callback(error, result). | ||
var parameters = processParameters(arguments); | ||
var message = parameters.message || '.'; | ||
var message = parameters.message || true; | ||
if (parameters.callback) | ||
@@ -200,3 +200,3 @@ { | ||
} | ||
exports.success(util.format(result)); | ||
exports.success('All tests successful: %s', util.inspect(result, true, 10, true)); | ||
} | ||
@@ -203,0 +203,0 @@ |
{ | ||
"name": "testing", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Simple testing framework.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/alexfernandez/testing", |
@@ -42,3 +42,3 @@ # testing | ||
Integration is very easy. | ||
Implementation is very easy, based around three functions. | ||
@@ -53,6 +53,8 @@ ### Basics | ||
#### testing.success([callback]) | ||
#### testing.success([message], [callback]) | ||
Note success for the current test. | ||
Note success for the current test. An optional message is shown if there is no callback. | ||
If there is a callback, then it is called with the message. | ||
#### testing.failure([message], [callback]) | ||
@@ -106,2 +108,14 @@ | ||
### Showing results | ||
You can use your own function to show results. The library provides a premade callback: | ||
#### testing.show(error, result) | ||
Show an error if present, a success if there was no error. | ||
### Sample code | ||
This same library has some sample code in index.js, check it out! | ||
## License | ||
@@ -108,0 +122,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10400
130