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
{{ message }}
Repository navigation
nextResult/nextError return the internal state, not the spy, so chaining throws #60
The internal state has no nextResult/nextError of its own, so the chain the types promise compiles and then throws:
consts=spy(()=>'real')s.nextResult('a').nextResult('b')// TypeError: s.nextResult(...).nextResult is not a function
console.log(s.nextResult('a')===s)// false
Calling them as separate statements works fine, so this only bites chaining.
willCall in internalSpyOn does return spy, which is presumably the intent here too — happy to send a PR making these return the spy if that's the direction you'd want.
Found while writing the API reference in #59; I left chaining out of the docs because of this.
Activity