Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

close the server properly

  • Loading branch information...
commit abebe5aecbd0f1e38d45e618308c5f4b2e051994 1 parent db95bca
Thomas Blobaum authored July 18, 2012

Showing 1 changed file with 6 additions and 4 deletions. Show diff stats Hide diff stats

  1. 10  test/pixel-tracker.js
10  test/pixel-tracker.js
... ...
@@ -1,10 +1,12 @@
1 1
 var express = require('express')
2 2
   , test = require('tap').test
3 3
   , tracker = require('../')
  4
+  , server
  5
+  , app
4 6
 
5 7
 test('testing pixel tracker', function (t) {
6 8
 
7  
-  var app = express.createServer()
  9
+  app = express.createServer()
8 10
 
9 11
   app.configure(function () {
10 12
     app.use(express.cookieParser())
@@ -30,15 +32,15 @@ test('testing pixel tracker', function (t) {
30 32
     })
31 33
 
32 34
   app.all('/pixel', tracker.middleware)
33  
-  app.listen(3000)
  35
+  server = app.listen(3000)
34 36
 
35 37
   require('http').get({ 
36 38
       host : 'localhost'
37 39
     , port : 3000
38 40
     , path : '/pixel'
39 41
     , agent : false
40  
-  }, function (res) {
41  
-    app.close()
  42
+  }, function () {
  43
+    server.close()
42 44
   })
43 45
 
44 46
 })

0 notes on commit abebe5a

Please sign in to comment.
Something went wrong with that request. Please try again.