dwyl / learn-tdd

:white_check_mark: A brief introduction to Test Driven Development (TDD) in JavaScript (Complete Beginner's Step-by-Step Tutorial)
Mozilla Public License 2.0
2.74k stars 349 forks source link

Cheat implementation introduces a regression #124

Closed mattdrago closed 5 years ago

mattdrago commented 5 years ago

With the cheat implementation of the getChange function, the initial test that was written getChange(1,1) should equal [] - an empty array now fails; a regression has been introduced.

As a person learning TDD
I want to see an example of a regression being solved
So that I can learn what to do when I introduce one myself

It would be good to show an example of index.html with the new test passing, but the original test failing. The guide could then go into dealing with regressions and ensuring that when new code is added that all tests must continue to pass.

Looking at the final image of index.html, it looks like the initial test has been removed. This may confuse the person learning TDD as they might think that they can delete tests once they have implemented the working code and the test is passing. It would be good to show all of the tests that have been written in the course of the discussion in the final image of index.html

mattdrago commented 5 years ago

Hey Folks,

I've completed the work on this one, just need to raise a pull request.

See https://github.com/mattdrago/learn-tdd for a preview of the changes if you like.

Cheers,

Matt

mattdrago commented 5 years ago

Refer to PR https://github.com/dwyl/learn-tdd/pull/125