Skip to content

Commit

Permalink
disable doctor tests temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
joehand committed Jul 5, 2018
1 parent 461b646 commit dbbd21e
Showing 1 changed file with 39 additions and 35 deletions.
74 changes: 39 additions & 35 deletions test/doctor.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
var path = require('path')
var test = require('tape')
var spawn = require('./helpers/spawn.js')
var help = require('./helpers')
// var path = require('path')
// var test = require('tape')
// var spawn = require('./helpers/spawn.js')
// var help = require('./helpers')
//

var dat = path.resolve(path.join(__dirname, '..', 'bin', 'cli.js'))
// TODO
// dat-doctor requires interactive testing right now...

test('misc - doctor option works ', function (t) {
var st = spawn(t, dat + ' doctor', {end: false})
st.stderr.match(function (output) {
var readyPeer = output.indexOf('Waiting for incoming connections') > -1
if (!readyPeer) return false
// var dat = path.resolve(path.join(__dirname, '..', 'bin', 'cli.js'))

if (!process.env.TRAVIS) {
// Not working on v4/v7 travis but can't reproduce locally
t.ok(output.indexOf('UTP') > -1, 'doctor connects to public peer via UTP')
}
t.ok(output.indexOf('TCP') > -1, 'doctor connects to public peer via TCP')
// test('misc - doctor option works ', function (t) {
// var st = spawn(t, dat + ' doctor', {end: false})
// st.stderr.match(function (output) {
// var readyPeer = output.indexOf('Waiting for incoming connections') > -1
// if (!readyPeer) return false

var key = help.matchLink(output)
startPhysiciansAssistant(key)
return true
}, 'doctor started')
// if (!process.env.TRAVIS) {
// // Not working on v4/v7 travis but can't reproduce locally
// t.ok(output.indexOf('UTP') > -1, 'doctor connects to public peer via UTP')
// }
// t.ok(output.indexOf('TCP') > -1, 'doctor connects to public peer via TCP')

function startPhysiciansAssistant (link) {
var assist = spawn(t, dat + ' doctor ' + link, {end: false})
assist.stderr.match(function (output) {
var readyPeer = output.indexOf('Waiting for incoming connections') > -1
if (!readyPeer) return false
// var key = help.matchLink(output)
// startPhysiciansAssistant(key)
// return true
// }, 'doctor started')

t.same(help.matchLink(output), link, 'key of peer matches')
t.ok(readyPeer, 'starts looking for peers')
t.skip(output.indexOf('Remote peer echoed expected data back') > -1, 'echo data back')
st.kill()
return true
})
assist.end(function () {
t.end()
})
}
})
// function startPhysiciansAssistant (link) {
// var assist = spawn(t, dat + ' doctor ' + link, {end: false})
// assist.stderr.match(function (output) {
// var readyPeer = output.indexOf('Waiting for incoming connections') > -1
// if (!readyPeer) return false

// t.same(help.matchLink(output), link, 'key of peer matches')
// t.ok(readyPeer, 'starts looking for peers')
// t.skip(output.indexOf('Remote peer echoed expected data back') > -1, 'echo data back')
// st.kill()
// return true
// })
// assist.end(function () {
// t.end()
// })
// }
// })

0 comments on commit dbbd21e

Please sign in to comment.