Permalink
Browse files

Added quiet config. Exposed test, so you can finish the process manually

  • Loading branch information...
1 parent da8ba35 commit a019a76dc1e459afd338ce78d1564d95541a3637 @masylum committed Jan 2, 2011
Showing with 13 additions and 11 deletions.
  1. +12 −10 lib/testosterone.js
  2. +1 −1 package.json
View
@@ -21,13 +21,6 @@ module.exports = function (config) {
});
},
- test = function () {
- if (count_responses === done_responses) {
- sys.print(colorize('\n[grey]{» ' + done_responses + ' responses, ' + passed_asserts + ' asserts}\n'));
- process.exit();
- }
- },
-
// extend assert
assert = (function () {
var assert = require('assert'),
@@ -168,7 +161,7 @@ module.exports = function (config) {
// Callback
callback(response);
done_responses += 1;
- test();
+ testosterone.test();
});
});
request.end();
@@ -178,7 +171,6 @@ module.exports = function (config) {
// refactor this a little bit
testosterone[method] = function (route, req, res, callback) {
count_responses += 1;
- test();
if (typeof req === 'function') {
callback = req;
res = {};
@@ -192,7 +184,17 @@ module.exports = function (config) {
});
testosterone.assert = assert;
- sys.print(colorize('[yellow]{✿ Testosterone}\n'));
+
+ testosterone.test = function () {
+ if (count_responses === done_responses) {
+ sys.print(colorize('\n[grey]{» ' + done_responses + ' responses, ' + passed_asserts + ' asserts}\n'));
+ process.exit();
+ }
+ };
+
+ if (!config.quiet) {
+ sys.print(colorize('[yellow]{✿ Testosterone}\n'));
+ }
return testosterone;
};
View
@@ -1,7 +1,7 @@
{
"name": "testosterone",
"description": "Synchronous testing for virile http servers",
- "version": "0.0.6",
+ "version": "0.0.7",
"repository": "git://github.com/masylum/testosterone.git",
"author": "Pau Ramon Revilla <masylum@gmail.com>",
"directories": {

0 comments on commit a019a76

Please sign in to comment.