How do you fix a failing test?
A failing test gives you the chance to fix a bug before problems occur from it. To fix a test, the function must do what the test output describes. Run tests every time you modify code and before releasing a new version to users. Also, add tests on a regular basis to match your code updates.