Skip to content

Commit

Permalink
Arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
bvalosek committed Jan 17, 2014
1 parent 3da9d1f commit 6d06f02
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/get-args.js
@@ -0,0 +1,17 @@
var test = require('tape');
var getArgs = require('../lib/getArguments.js');

test('Basic arguments', function(t) {
t.plan(4);

function f() { }
function g(a) { }
function h(a, b) { }
function i(a, b, c) { }

t.deepEqual(getArgs(f), [], 'no args');
t.deepEqual(getArgs(g), ['a'], '1 arg');
t.deepEqual(getArgs(h), ['a', 'b'], '2 args');
t.deepEqual(getArgs(i), ['a', 'b', 'c'], '3 args');

});

0 comments on commit 6d06f02

Please sign in to comment.