mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(cloudcmd) --columns: add ability to set visible columns (#146)
This commit is contained in:
parent
6c9913e5f1
commit
b5f98be162
18 changed files with 115 additions and 30 deletions
|
|
@ -107,6 +107,37 @@ test('validate: editor: not valid', (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('validate: columns', (t) => {
|
||||
const fn = sinon.stub();
|
||||
|
||||
clean();
|
||||
require(exitPath);
|
||||
stub(exitPath, fn);
|
||||
|
||||
const {columns} = require(validatePath);
|
||||
|
||||
columns('name-size-date');
|
||||
|
||||
t.notOk(fn.called, 'should not call exit');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('validate: columns: wrong', (t) => {
|
||||
const fn = sinon.stub();
|
||||
|
||||
clean();
|
||||
require(exitPath);
|
||||
stub(exitPath, fn);
|
||||
|
||||
const {columns} = require(validatePath);
|
||||
const msg = 'cloudcmd --columns: could be "name-size-date" or "name-size-date-owner-mode"';
|
||||
|
||||
columns('hello');
|
||||
|
||||
t.ok(fn.calledWith(msg), 'should call exit');
|
||||
t.end();
|
||||
});
|
||||
|
||||
function clean() {
|
||||
clear(validatePath);
|
||||
clear(exitPath);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue