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

Add unit tests to Fn UI #74

Merged
merged 4 commits into from
Jul 8, 2019
Merged

Conversation

vzDevelopment
Copy link
Contributor

About

I've made a start at adding some unit tests to the Fn UI. I've started with the Stats Parser classes. I'd like to also mock the Fn API calls and unit test those too, but that's for another day. I've added support to CircleCI so the tests are automatically run.

I've also snuck a short hand command to make running linting easier in too: npm run lint

Notes

I've used --loglevel silent for the npm install in CircleCI because it spurts out lots of errors/warnings currently (due to deprecated packages) when it's run. Cleaning all that up was on my list, but I didn't get around to it :(.

How to test

# Ensure you have the unit test libraries installed
npm install

# Run the tests
npm test
# Test new linting command
npm run lint

My Testing

I've tested by running npm test and npm run test-integration

As I've made changes to the Stats Parser classes I've also tested running functions using the UI and ensuring the charts update correctly.

Lastly, I checked CircleCI when I pushed to my fork to ensure everything was passing.

I am planning on adding unit tests for these parsers. Seperating them
out should make this easier, it keeps the files smaller and more
readable, plus it keeps things more organised.
Make a start on adding Unit Tests to the repo so that we can
automatically test code e.g. on pull requests.
We have recently made a start on adding Unit Tests. Run these Unit Tests
as part of CircleCI so that any PRs are automatically checked for
issues.
This means devs can now lint their code by running "npm run lint". This
is alot easier to remember and makes it easier to change the linter
should we choose to use another one in the future
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants