Skip to content

TestingΒ #21

@samatar26

Description

@samatar26

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions