Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose (TL;DR)
This PR removes the old
chain
behavior method introduced in #1227 since we're not using it anymore.This is also related to #817 and #1100.
Background (Problem in detail)
Since #1302, most of the old behaviors were moved to a file called
defaultBehaviors
and now we're using theaddBehavior
method to add behavior methods to thestub
. This method assigns a new function to the stub'sproto
and this method both runs the behavior method and then returnsthis.stub
orthis
ifthis.stub
is falsy, which is exactly the same thing thechain
behavior did.Due to this fact, the
chain
method is not useful anymore because we're not using it internally anymore and no user needs to call it, since every behavior will return exactly the same value (the stub itself). Another point that backs up this assumption is that we have no tests that testchain
specifically, which means this isn't something meant to be used by our end-users.Solution
Given the explanation above, I simply removed the
chain
behavior and all tests still pass.How to verify
npm install
npm test
-> All tests still passLet me know if I missed anything and I'll be more than happy to fix it. Thanks!