Skip to content

Commit

Permalink
resolve test timeout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmarkclements committed Jul 4, 2018
1 parent 89f8dca commit 1ce7e73
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/issue5.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const expect = require('chai').expect

test('issue #5', function (done) {
const server = net.createServer()
server.unref()
server.listen(() => {
const scriptPath = path.join(__dirname, 'fixtures', 'issue5.js')
const script = spawn('node', [ scriptPath ])
Expand All @@ -18,10 +19,8 @@ test('issue #5', function (done) {
script.stdout.pipe(psock.stdin)
psock.stdin.on('data', (data) => { output += data.toString() })
psock.stdout.on('close', () => {
server.close(() => {
expect(output.length > 0)
done()
})
expect(output.length > 0)
done()
})
})
})

0 comments on commit 1ce7e73

Please sign in to comment.