-
Notifications
You must be signed in to change notification settings - Fork 1
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
melodicht
wants to merge
16
commits into
dev
Choose a base branch
from
melodicht/maintainability
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
added
documentation
Improvements or additions to documentation
enhancement
New feature or request
wip
Work in progress
labels
Jul 6, 2021
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 testnpm 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 theindex.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 theREADME.md
).