mozillach / gh-projects-content-queue

A Twitter content curation queue based on GitHub projects.
Mozilla Public License 2.0
7 stars 8 forks source link

Write more unit tests! #17

Open freaktechnik opened 7 years ago

freaktechnik commented 7 years ago

Currently only very little functionality is tested. If there is already a test file some potential unit tests are marked using the test.todo() function.

More generic things that need to be done for easier testing:

freaktechnik commented 7 years ago

The unit tests use ava, a modern test runner. To learn more about ava, visit its repo: https://github.com/avajs/ava

All the suggested unit tests are calls to the todo() method on test. To implement a test, remove the .todo and add a function as the second argument that will run as test. You get an argument on which you can make assertions. There is always at least one test implemented in a file, so you have a rough reference of how ava works (and to satisfy eslint).

freaktechnik commented 7 years ago

It seems that the github client can take the token as token for testing.

freaktechnik commented 6 years ago

I've started _stubs.js as a collection for stubs of objects used within the application. New ones should probably be available via that module, but not necessarily defined within the module, depending on complexity.