This repository has been archived on 2020-01-20. You can view files and clone it, but cannot push or open issues or pull requests.
node-spearhead/test/integration/cli-basics.test.js

73 lines
1.9 KiB
JavaScript
Raw Normal View History

2015-09-01 10:31:00 +03:00
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (c) 2015, Joyent, Inc.
*/
/*
* Integration tests for `triton ...` CLI basics.
*/
var h = require('./helpers');
var test = require('tape');
// --- Globals
// --- Tests
test('triton (basics)', function (tt) {
tt.test(' triton --version', function (t) {
h.triton('--version', function (err, stdout, stderr) {
if (h.ifErr(t, err, 'triton --version'))
return t.end();
t.ok(/^Triton CLI \d+\.\d+\.\d+/.test(stdout),
'version on first line');
t.ok(/^https:/m.test(stdout), 'project link in version output');
2015-09-01 10:31:00 +03:00
t.end();
});
});
tt.test(' triton -h', function (t) {
h.triton('-h', function (err, stdout, stderr) {
if (h.ifErr(t, err))
return t.end();
t.ok(/^Usage:$/m.test(stdout));
t.ok(/triton help COMMAND/.test(stdout));
t.ok(/instance/.test(stdout));
2015-09-01 10:31:00 +03:00
t.end();
});
});
tt.test(' triton --help', function (t) {
h.triton('--help', function (err, stdout, stderr) {
if (h.ifErr(t, err))
return t.end();
t.ok(/^Usage:$/m.test(stdout));
t.ok(/triton help COMMAND/.test(stdout));
t.ok(/instance/.test(stdout));
2015-09-01 10:31:00 +03:00
t.end();
});
});
tt.test(' triton help', function (t) {
h.triton('help', function (err, stdout, stderr) {
if (h.ifErr(t, err))
return t.end();
t.ok(/^Usage:$/m.test(stdout));
t.ok(/triton help COMMAND/.test(stdout));
t.ok(/instance/.test(stdout));
2015-09-01 10:31:00 +03:00
t.end();
});
});
});