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
"To err is human, to purr feline" - t.throws(petDog('dachshund')) wrongly suggests providing function call result (rather than function) as argument
#5
Closed
sneakertack opened this issue
Apr 9, 2015
· 1 comment
The provided example t.throws(petDog('dachshund')) can lead the student to wrongly conclude that analogous solution for feedCat is t.throws(feedCat('chocolate')) - which fails because throws wants a function to call, not the value/error from an already called function.
Suggest amending example to:
t.throws(function(){petDog('dachshund');})
Or alternatively, using petDog.bind, like feedCat.bind in the solution.
The text was updated successfully, but these errors were encountered:
The provided example
t.throws(petDog('dachshund'))
can lead the student to wrongly conclude that analogous solution forfeedCat
ist.throws(feedCat('chocolate'))
- which fails becausethrows
wants a function to call, not the value/error from an already called function.Suggest amending example to:
Or alternatively, using
petDog.bind
, likefeedCat.bind
in the solution.The text was updated successfully, but these errors were encountered: