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
Some of the tests manually set internal state variables, such as .connected, in order to test that functions change this state. This makes for a lot of work to update all the tests if the internal state management changes. The code would be more maintainable if tests used public API functions to alter state when this is reasonable to do.
Approach I plan:
review all tests for patterns such as .member = value or ._member
change unneccessary ones to use public API functions in case the code assumes more state than the test does
for cases where this seems necessary, ensure the use of internal state matches the assumptions the internal code makes, and add a todo item or issue to mention the use
The text was updated successfully, but these errors were encountered:
This has totally changed the way I have been writing my tests for my main project (the one that uses this library) and holy smokes totally makes more sense to use public API method calls throughout and not muck with the internals. GOOD CALL Karl!
Some of the tests manually set internal state variables, such as
.connected
, in order to test that functions change this state. This makes for a lot of work to update all the tests if the internal state management changes. The code would be more maintainable if tests used public API functions to alter state when this is reasonable to do.Approach I plan:
.member = value
or._member
The text was updated successfully, but these errors were encountered: