-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add version, quiet, port, utp options * make quiet, utp booleans * start with tests * fix create. add test for port * add usage * skip port tests for now * add usage & doctor tests
- Loading branch information
Showing
12 changed files
with
153 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
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')) | ||
|
||
test('misc - doctor option works ', function (t) { | ||
var st = spawn(t, dat + ' doctor', {end: false}) | ||
st.stdout.match(function (output) { | ||
var key = help.matchLink(output) | ||
if (!key) return false | ||
startPhysiciansAssistant(key) | ||
return true | ||
}, 'doctor started') | ||
|
||
function startPhysiciansAssistant (link) { | ||
var assist = spawn(t, dat + ' doctor ' + link, {end: false}) | ||
assist.stdout.match(function (output) { | ||
if (output.indexOf('Public IP:') > -1) { | ||
st.kill() | ||
return true | ||
} | ||
}, 'download one started') | ||
assist.end(function () { | ||
t.end() | ||
}) | ||
} | ||
}) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
var path = require('path') | ||
var test = require('tape') | ||
var spawn = require('./helpers/spawn.js') | ||
|
||
var dat = path.resolve(path.join(__dirname, '..', 'bin', 'cli.js')) | ||
var version = require('../package.json').version | ||
|
||
test('misc - prints usage', function (t) { | ||
var d = spawn(t, dat) | ||
d.stderr.match(function (output) { | ||
var usage = output.indexOf('Usage') > -1 | ||
if (!usage) return false | ||
return true | ||
}) | ||
d.end() | ||
}) | ||
|
||
test('misc - prints version', function (t) { | ||
var d = spawn(t, dat + ' -v') | ||
d.stderr.match(function (output) { | ||
var ver = output.indexOf(version) > -1 | ||
if (!ver) return false | ||
return true | ||
}) | ||
d.end() | ||
}) | ||
|
||
test('misc - also prints version', function (t) { | ||
var d = spawn(t, dat + ' -v') | ||
d.stderr.match(function (output) { | ||
var ver = output.indexOf(version) > -1 | ||
if (!ver) return false | ||
return true | ||
}) | ||
d.end() | ||
}) |