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

Testing #21

Open
samatar26 opened this issue Jan 17, 2020 · 1 comment
Open

Testing #21

samatar26 opened this issue Jan 17, 2020 · 1 comment

Comments

@samatar26
Copy link

samatar26 commented Jan 17, 2020

As I was reviewing it, it looks like you've pushed a change that has broken the game 😄. The only tests I have seen are for the utils which are great!! But there are no integration tests, i.e. tests that tie together a lot of the functionality of the app, i.e. multiple components and functions. These tests would have allowed you to account for the 401 error you're receiving from submitting the form and starting the game and at least you show some sort of feedback to the user.

Pre-commit hooks are great for preventing bad code being pushed, husky (https://github.com/typicode/husky) is a really nice tool to use so you can run your tests before actually committing. A final safe-guard would be your CI/CD pipeline.

I really like https://testing-library.com/docs/react-testing-library/ and it's part of create-react-app so definitely use it to test your app as the tests will resemble how your users will use the app/game!

@freemvmt
Copy link
Collaborator

Hey samatar, thanks for these tips. We are definitely gonna go back in and write a bunch of tests with RTL right now. Obviously not a very TDD-compliant approach... We fixed the netlify deploy now (was just an env problem), so if you fancy trying again, please be our guest!

Also husky sounds awesome and will definitely check it out 😄

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

No branches or pull requests

2 participants