[Pkg-javascript-commits] [node-subarg] 01/17: failing test

Bastien Roucariès rouca at moszumanska.debian.org
Fri Aug 25 19:28:11 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-subarg.

commit 55ae9467054f67a68f3a96440b4acc38d710a363
Author: James Halliday <mail at substack.net>
Date:   Sat Feb 8 19:15:34 2014 -0800

    failing test
---
 index.js    |  6 ++++++
 test/arg.js | 31 +++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/index.js b/index.js
new file mode 100644
index 0000000..a84b000
--- /dev/null
+++ b/index.js
@@ -0,0 +1,6 @@
+var minimist = require('minimist');
+
+module.exports = function (args, opts) {
+    var argv = minimist(args, opts);
+    return argv;
+};
diff --git a/test/arg.js b/test/arg.js
new file mode 100644
index 0000000..d275168
--- /dev/null
+++ b/test/arg.js
@@ -0,0 +1,31 @@
+var subarg = require('../');
+var test = require('tape');
+
+test('spaced multi sub-args', function (t) {
+    t.plan(2);
+    
+    t.deepEqual(
+        subarg('beep -t [ boop -o a.txt -o b.txt -q ] -v'),
+        {
+            _: [ 'beep'],
+            t: {
+                _: [ 'boop' ],
+                o: [ 'a.txt', 'b.txt' ],
+                q: true
+            },
+            v: true
+        }
+    );
+    t.deepEqual(
+        subarg('beep -t [boop -o a.txt -o b.txt -q] -v'),
+        {
+            _: [ 'beep'],
+            t: {
+                _: [ 'boop' ],
+                o: [ 'a.txt', 'b.txt' ],
+                q: true
+            },
+            v: true
+        }
+    );
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-subarg.git



More information about the Pkg-javascript-commits mailing list