Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Writing [self-testing code](http://www.martinfowler.com/bliki/SelfTestingCode.html) is a powerful tool for building robust and maintainable software. While there are many ways of writing test code, I enjoy using [Test Driven Development](#) for solving problems like this. Following the ideas of TDD, we'll write the simplest test we can that results in failure. We expect `deleteNth([], 0)` to return an empty array. After writing this test and running our test suite, the test fails: deleteNth is not defined We need to export `deleteNth` from our module under test and import it into our test file. After making those changes, the test suite is still failing: expected undefined to deeply equal [] Because our `deleteNth` method isn't returning anything our assertion that it should return `[]` is failing. A quick way to bring our test suite into a passing state is to have `deleteNth` return `[]`.
- Loading branch information