joyent/node-triton#199 cli-networks.test.js crash if there are no non-public networks

Reviewed by: Jason King <jason.king@joyent.com>
Approved by: Jason King <jason.king@joyent.com>
This commit is contained in:
Trent Mick 2017-04-13 12:30:50 -07:00
parent b69832c227
commit 8493c52be3

View File

@ -71,10 +71,13 @@ test('triton networks', function (tt) {
function (err, stdout, stderr) {
if (h.ifErr(t, err))
return t.end();
var results = stdout.trim().split('\n');
results.forEach(function (result) {
t.equal(false, common.boolFromString(result, null, 'public'));
});
if (stdout.trim()) {
var results = stdout.trim().split('\n');
results.forEach(function (result) {
t.equal(false,
common.boolFromString(result, null, 'public'));
});
}
t.end();
});
});
@ -84,10 +87,13 @@ test('triton networks', function (tt) {
function (err, stdout, stderr) {
if (h.ifErr(t, err))
return t.end();
var results = stdout.trim().split('\n');
results.forEach(function (result) {
t.equal(false, common.boolFromString(result, null, 'public'));
});
if (stdout.trim()) {
var results = stdout.trim().split('\n');
results.forEach(function (result) {
t.equal(false,
common.boolFromString(result, null, 'public'));
});
}
t.end();
});
});