]> khamidou — GitHub mirrors - electron.git/commitdiff
spec: Only test net.connect on Mac
authorCheng Zhao <zcbenz@gmail.com>
Tue, 28 Oct 2014 01:48:32 +0000 (09:48 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 28 Oct 2014 02:09:47 +0000 (10:09 +0800)
The Linux travis ci machine is quite unstable on this test.

spec/node-spec.coffee

index bf13a06cd6bd76f24f2589a926a7a877545bb97c..46dcd381aed53d4136dccd62273e1d46817016aa 100644 (file)
@@ -96,13 +96,14 @@ describe 'node feature', ->
             setImmediate done
 
   describe 'net.connect', ->
-    it 'emit error when connect to a socket path without listeners', (done) ->
-      return done() if process.platform is 'win32'
+    return unless process.platform is 'darwin'
 
+    it 'emit error when connect to a socket path without listeners', (done) ->
       socketPath = path.join os.tmpdir(), 'atom-shell-test.sock'
       script = path.join(fixtures, 'module', 'create_socket.js')
       child = child_process.fork script, [socketPath]
-      child.on 'exit', ->
+      child.on 'exit', (code) ->
+        assert.equal code, 0
         client = require('net').connect socketPath
         client.on 'error', (error) ->
           assert.equal error.code, 'ECONNREFUSED'