You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verify doesn't throw exceptions when too many arguments are passed. Right now its only on too few arguments or collisions.
I expected td.verify(double('any', 'parameters')) to default to checking arity, but currently only fails on too few arguments. Here's an example reproduction:
In a file td-repro.js
vartd=require('testdouble'),test=require('tape')test('verify tests arity matches',function(t){t.plan(4)varstub0=td.create()varstub1=td.create()varstub2=td.create()varstub3=td.create()t.doesNotThrow(function(){stub0('any arguments',0,1,2)td.verify(stub0())},'called with more arguments when none are specified')t.throws(function(){stub1(0)td.verify(stub2(0,0))},'called with fewer arguments fails')t.doesNotThrow(function(){stub2(0,0)td.verify(stub2(0,0))},'called with the same number succeeds')t.throws(function(){stub3(0,0,1)td.verify(stub3(0,0))},'called with more arguments fails')// <-- does not fail})
The command node td-repro.js gives this output:
TAP version 13
# verify tests arity matches
ok 1 called with more arguments when none are specified
ok 2 called with fewer arguments fails
ok 3 called with the same number succeeds
not ok 4 called with more arguments fails
---
operator: throws
expected: undefined
actual: undefined
at: Test.<anonymous> (/Users/matthew/Projects/scrap/td-bug.js:27:5)
...
1..4
# tests 4
# pass 3
# fail 1
The text was updated successfully, but these errors were encountered:
Verify doesn't throw exceptions when too many arguments are passed. Right now its only on too few arguments or collisions.
I expected
td.verify(double('any', 'parameters'))
to default to checking arity, but currently only fails on too few arguments. Here's an example reproduction:In a file
td-repro.js
The command
node td-repro.js
gives this output:The text was updated successfully, but these errors were encountered: