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
When using the simulate function the tests can pass but multiple errors will generate inside of the console window. This is likely tied to the fact that the built-in function move_and_slide_with_snap is being used inside our _physics_process. An attempted solution was to make the object being tested, the player controller, be a partial double and to stub the move_and_slide_with_snap function so that it returns a unit vector. This presented a new issue however being that the move_and_slide_with_snap expects to assign a variable with its return value, which in this case is the velocity being tested. This meant that the velocity variable being asserted was always equal to the unit vector instead of the expected values. It would be useful if a stubbed function could be set to return the passed in value.
Click for image.
The text was updated successfully, but these errors were encountered:
Description of issue
When using the simulate function the tests can pass but multiple errors will generate inside of the console window. This is likely tied to the fact that the built-in function move_and_slide_with_snap is being used inside our _physics_process. An attempted solution was to make the object being tested, the player controller, be a partial double and to stub the move_and_slide_with_snap function so that it returns a unit vector. This presented a new issue however being that the move_and_slide_with_snap expects to assign a variable with its return value, which in this case is the velocity being tested. This meant that the velocity variable being asserted was always equal to the unit vector instead of the expected values. It would be useful if a stubbed function could be set to return the passed in value.
Click for image.
The text was updated successfully, but these errors were encountered: