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 Automated Tests #3

Open
princefishthrower opened this issue Sep 30, 2021 · 6 comments
Open

Add Automated Tests #3

princefishthrower opened this issue Sep 30, 2021 · 6 comments
Assignees
Labels
hacktoberfest Issue designated for Hacktoberfest

Comments

@princefishthrower
Copy link
Owner

Other than doing some smoke tests via the interactive demo site, I have no other testing method currently for the code in this repo 😅

I'm partial to end-to-end testing tools for a project like this (like cypress for example) because our tests can truly observe the changes in document.title and the <link rel="..."> values.

I'm looking for the following:

  • End to end test to be written in a tool like Cypress (doesn't have to be Cypress, if you can convince me otherwise)
    • Cycle through all possible option configurations with multiple values
    • Keep tests small so it is easy to see exactly which test is testing what
  • I'm also open to unit tests, though less experienced with them. It's also debatable if a repository this size needs them. Then again, perhaps we need them exactly because of the simplicity of the codebase - small changes can potentially break the whole hook.

This PR could potentially expand into multiple PRs - setting up tests first locally, then adding it to a CI / CD process (which also doesn't exist yet 😅 ) etc. etc.

@princefishthrower princefishthrower added the hacktoberfest Issue designated for Hacktoberfest label Sep 30, 2021
@wsameer
Copy link

wsameer commented Oct 2, 2021

Adding unit tests gives you better sleep. Also they can be integrated into the CI/CD pipe-line too.

@princefishthrower
Copy link
Owner Author

@wsameer sounds good. Do you have a preferred library in mind? (Ideally, one that works well with React + TypeScript)

@wsameer
Copy link

wsameer commented Oct 2, 2021

@wsameer sounds good. Do you have a preferred library in mind? (Ideally, one that works well with React + TypeScript)
My go-to combo is always JEST + Testing Library

@princefishthrower
Copy link
Owner Author

@wsameer - sounds good to me. Do you want to take this one?

@AbhimanyuBahree
Copy link
Contributor

I could give JEST testing library a shot. Will PR if successfull.

@princefishthrower
Copy link
Owner Author

@babu1998 - any update here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issue designated for Hacktoberfest
Projects
None yet
Development

No branches or pull requests

3 participants