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
The design of 7.0 already loosely following this, but can make it more formal which can help simplifying the code and improving certain use cases.
During simulation, some references will be stubs to simulate the behavior and some will be spy to validate the behavior.
This is done by analyzing the relationship between the references.
It's like this:
If the target/subject is a function and it is invoked with some arguments, you should validate the input so they should be spy?
If the target/subject is a function and it was invoked and now returning a value, it should be stub?
There are more complex cases such as the argument is an object which is accessed by the code outside of the subject after a call in invoked. So while within the subject it should be stub, but outside the subject it should be spy.
These cases are not currently covered.
The text was updated successfully, but these errors were encountered:
The design of 7.0 already loosely following this, but can make it more formal which can help simplifying the code and improving certain use cases.
During simulation, some references will be stubs to simulate the behavior and some will be spy to validate the behavior.
This is done by analyzing the relationship between the references.
It's like this:
If the
target/subject
is a function and it is invoked with some arguments, you should validate the input so they should be spy?If the
target/subject
is a function and it was invoked and now returning a value, it should be stub?There are more complex cases such as the argument is an object which is accessed by the code outside of the subject after a call in invoked. So while within the subject it should be stub, but outside the subject it should be spy.
These cases are not currently covered.
The text was updated successfully, but these errors were encountered: