Permalink
Browse files

Update test to take advantage of new 'server ready' hooks, and stop s…

…erver when test is done.
  • Loading branch information...
1 parent 9ac5c13 commit e1243a67f3d9048fb783b8eb04582f3c89810c57 @mhansen committed May 14, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 tests/test-numbers.js
View
@@ -12,10 +12,10 @@ var settings = {
"port": PORT,
"default_host" : {
"root": path.join(fixturesDir,"default-host")
- }
+ },
+ "log_level": 4 //silent
}
-antinode.start(settings);
-setTimeout(function() {
+antinode.start(settings, function() {
var client = http.createClient(PORT, 'localhost');
var request = client.request('GET', '/'+file);
request.addListener('response', function (response) {
@@ -24,7 +24,8 @@ setTimeout(function() {
response.addListener('data', function (chunk) {
assert.equal(chunk, fileText);
puts("OK");
+ antinode.stop();
});
});
request.end();
-}, 1000);
+});

0 comments on commit e1243a6

Please sign in to comment.