Initial commit
This commit is contained in:
14
node_modules/cliss/test/specs/simple-cli/index.js
generated
vendored
Normal file
14
node_modules/cliss/test/specs/simple-cli/index.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
const cliss = require('../../../');
|
||||
|
||||
const cliSpec = {
|
||||
name: 'simple-cli',
|
||||
action: (param1 = 'defaultParam1', param2) => `${param1}-${param2}`,
|
||||
};
|
||||
|
||||
cliss(cliSpec, {
|
||||
help: {
|
||||
stripAnsi: true
|
||||
}
|
||||
});
|
||||
30
node_modules/cliss/test/specs/simple-cli/specs.js
generated
vendored
Normal file
30
node_modules/cliss/test/specs/simple-cli/specs.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
const tests = [
|
||||
{
|
||||
description: 'object specification + passing in options / args',
|
||||
input: '--param1=A --param2=B',
|
||||
output: `A-B`
|
||||
},
|
||||
|
||||
{
|
||||
description: 'Passing in only one argument',
|
||||
input: '--param2=B',
|
||||
output: `defaultParam1-B`
|
||||
},
|
||||
|
||||
{
|
||||
input: '--help',
|
||||
output: `
|
||||
Usage:
|
||||
|
||||
$ simple-cli [options]
|
||||
|
||||
Options:
|
||||
|
||||
--param1
|
||||
--param2
|
||||
`
|
||||
}];
|
||||
|
||||
module.exports = tests;
|
||||
Reference in New Issue
Block a user