         before 'wait for server to listen', (done) ->
           # call done() when it successfully listens...
           server.listen serverPort, 'localhost', ->
-            if server.listening then done()
+            # Note: node 0.12 and node 4 don't have server.listening ...
+            if listening > 0 then done()
 
         before 'wait for server to close', (done) ->
           server.on 'close', ->

              serverConnection.on 'data', (data) -> received = data.toString 'utf8'
              serverConnection.on 'end', -> server.close()

          # once the server is listening do the client stuffs
          server.on 'listening', ->
            listening = true

            # create a client via `cio` with its transform and the same port as the server
            client = cio.client
              port: server.address().port
              key : helperFile 'client.private.pem'
              cert: helperFile 'client.cert.pem'
              ca  : helperFile 'ca.cert.pem'
              onConnect: ->
                connected = true
                client.end 'done', 'utf8'

        before 'wait for server to listen', (done) ->
          server.listen 2468, 'localhost', done

          # create a client via `cio` with its transform and the same port as the server
          client = cio.client
            port     : server.address().port
            host     : 'localhost'
            onConnect: ->
              connected++
              client.end 'done', 'utf8'
