Testing - noobling/Homefornow GitHub Wiki
This is an important part of any large maintainable software project. There are numerous reasons why we need tests but the most compelling one to me is so that you have some confidence that the new code you are introducing doesn't break your application.
Commands to use for tests
- Seed data:
npm run seed
- Run tests:
npm test
ornpm run mocha
if on windows
When to add tests
As a general rule I would say every time a new route is introduced you should write tests for it
How to add tests
Just copy how the other tests are set out but one thing to be aware off is that you need to add this to the end of the last test file.
after((done) => {
done();
// Done with the tests time to close. This should be placed in the last test file
process.exit();
});