Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve maintainability by adding unit testing and further documentation #44

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from

Conversation

melodicht
Copy link
Contributor

Introducing Jest.js

Jest.js allows us to create unit tests. It will take time and patience to make them. However, they will save us from hours of debugging, so they will actually us time in the long run. I will soon include a guide on how to use Jest.js to create unit tests.

npm run test: run a single test
npm run test:watch: the test will run itself every time you save. Only failed tests will show. This is useful for test-driven development.

Using TSDoc and TypeDoc for documentation

There is a new /docs directory. If you open the index.html file on your favourite web browser, you will be able to view the documentation of the code via a locally hosted website. However, I have yet to bring most of the code in (as a matter of fact, everything apart from the README.md).

melodicht added 13 commits July 3, 2021 21:53
To reduce redundant ESLint warnings.
Yarn manages dependencies.
Added further dependencies from Babel, to support Jest JS.

`gaze-run-interrupt` has also been added to support the
test-driven development (tdd) workflow.
(should have done this with `package.json`, my bad)
Run `./tdd` or `npm run tdd`, and the tests will run as you save.
Tests that succeed would only clutter the screen.

If one would like to see them, one can run `npm run test`.
Adding TSDoc and TypeDoc
- To view documentation on web.

- ESLint made to ignore js files in `/doc`
To clear all mocks before beginning individual unit tests,
reducing tests leak.
- Add helper functions, likely to be stored in new document in the future
@melodicht melodicht added documentation Improvements or additions to documentation enhancement New feature or request wip Work in progress labels Jul 6, 2021
@melodicht melodicht self-assigned this Jul 6, 2021
@melodicht melodicht changed the base branch from main to dev July 6, 2021 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request wip Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant