aboutsummaryrefslogtreecommitdiff
path: root/node_modules/nomnom/test/usage.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
commitcc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch)
tree92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/nomnom/test/usage.js
parent3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff)
remove node_modules
Diffstat (limited to 'node_modules/nomnom/test/usage.js')
-rw-r--r--node_modules/nomnom/test/usage.js121
1 files changed, 0 insertions, 121 deletions
diff --git a/node_modules/nomnom/test/usage.js b/node_modules/nomnom/test/usage.js
deleted file mode 100644
index 9a0817935..000000000
--- a/node_modules/nomnom/test/usage.js
+++ /dev/null
@@ -1,121 +0,0 @@
-var nomnom = require("../nomnom");
-
-function strip(str) {
- return str.replace(/\s+/g, '');
-};
-
-var opts = {
- apple: {
- abbr: 'a',
- help: 'how many apples'
- },
-
- banana: {
- full: "b-nana"
- },
-
- carrot: {
- string: '-c NUM, --carrots=NUM'
- },
-
- dill: {
- metavar: 'PICKLE'
- },
-
- egg: {
- position: 0,
- help: 'robin'
- }
-}
-
-var parser = nomnom().options(opts).help("all the best foods").scriptName("test").nocolors();
-
-var expected = "Usage:test[egg][options]eggrobinOptions:-a,--applehowmanyapples--b-nana-cNUM,--carrots=NUM--dillPICKLEallthebestfoods"
-
-exports.testH = function(test) {
- test.expect(1);
-
- parser.printer(function(string) {
- test.equal(strip(string), expected)
- test.done();
- })
- .nocolors()
- .parse(["-h"]);
-}
-
-exports.testHelp = function(test) {
- test.expect(1);
-
- parser.printer(function(string) {
- test.equal(strip(string), expected)
- test.done();
- })
- .nocolors()
- .parse(["--help"]);
-}
-
-exports.testScriptName = function(test) {
- test.expect(1);
-
- nomnom()
- .script("test")
- .printer(function(string) {
- test.equal(strip(string),"Usage:test")
- test.done();
- })
- .nocolors()
- .parse(["-h"]);
-}
-
-exports.testUsage = function(test) {
- test.expect(1);
-
- parser
- .usage("test usage")
- .printer(function(string) {
- test.equal(string, "test usage")
- test.done();
- })
- .nocolors()
- .parse(["--help"]);
-}
-
-exports.testHidden = function(test) {
- test.expect(1);
-
- nomnom().options({
- file: {
- hidden: true
- }
- })
- .scriptName("test")
- .printer(function(string) {
- test.equal(strip("Usage:test[options]Options:"), strip(string))
- test.done();
- })
- .nocolors()
- .parse(["-h"]);
-}
-
-exports.testRequiredOptional = function(test) {
- test.expect(1);
-
- nomnom().options({
- foo: {
- position: 0,
- required: true,
- help: 'The foo'
- },
- bar: {
- position: 1,
- help: 'The bar'
- }
- })
- .scriptName("test")
- .printer(function(string) {
- test.equal(strip("Usage:test<foo>[bar]fooThefoobarThebar"), strip(string))
- test.done();
- })
- .nocolors()
- .parse(["-h"]);
-}