Comparing version 0.1.3 to 0.1.4
@@ -29,2 +29,6 @@ var http = require('http'); | ||
if (this.started) { | ||
return callback(); | ||
} | ||
this.server.listen(this.port, function (err) { | ||
@@ -43,2 +47,6 @@ if (!err) { | ||
if (this.stopped) { | ||
return callback(); | ||
} | ||
this.server.close(function (err) { | ||
@@ -45,0 +53,0 @@ if (!err) { |
{ | ||
"name": "mocksy", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Mock http server for testing. Regurgitates the request object.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,9 +26,15 @@ var test = require('tape'); | ||
mocksy.start(function () { // test for server already started | ||
mocksy.stop(function (err) { | ||
t.equal(mocksy.started, false, 'server is not started'); | ||
t.equal(mocksy.stopped, true, 'server is stopped'); | ||
mocksy.stop(function () { | ||
// test for already stopped server | ||
t.end(); | ||
}); | ||
}); | ||
}); | ||
mocksy.stop(function (err) { | ||
t.equal(mocksy.started, false, 'server is not started'); | ||
t.equal(mocksy.stopped, true, 'server is stopped'); | ||
t.end(); | ||
}); | ||
}); | ||
@@ -35,0 +41,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
4517
94