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

feat: add tests infrastructure #50

Merged

Conversation

takanome-dev
Copy link
Contributor

Description

This PR:

  • adds cypress for e2e tests
  • adds vitest for unit/integration tests
  • adds test for lib/utils/capitalize.ts utility
  • fixes a typo in the contributing file

Related Issue

Fixes #29

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

@vercel
Copy link

vercel bot commented Feb 7, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @TechIsHiring on Vercel.

@TechIsHiring first needs to authorize it.

@chadstewart
Copy link
Collaborator

Okay, so this is new! I'll have to fix that.

Actually @takanome-dev, do you havw recommendations on how to accept contributions? Should be a way to avoid this error in the future but still leaving the responsibility for reviewing the PR to the maintainer.

Yikes man, I'm so new to managing an open source project! 🤣

@chadstewart
Copy link
Collaborator

Oh thanks by the way for all of this initial work! Really appreciate it a bunch!

@takanome-dev
Copy link
Contributor Author

Actually @takanome-dev, do you havw recommendations on how to accept contributions? Should be a way to avoid this error in the future but still leaving the responsibility for reviewing the PR to the maintainer.

It seems like you have deployment protection enabled. I think only people on the team can view the deploy previews. If you want the deploy preview to be available on all prs, you may need to change your configs. Learn more -> https://vercel.com/docs/concepts/deployments/deployment-protection

Yikes man, I'm so new to managing an open source project! 🤣

It's tough 😅, I don't have that much experience in managing open source, but I did start one which is on standby (needs design)

@vercel
Copy link

vercel bot commented Feb 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
techishiring-website ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 9, 2023 at 6:15PM (UTC)

@chadstewart
Copy link
Collaborator

Hey @takanome-dev, looks like they're some ESLint rules that are causing errors. Do you mind fixing that please? Deploy's failing because of it.

@takanome-dev
Copy link
Contributor Author

Hey @takanome-dev, looks like they're some ESLint rules that are causing errors. Do you mind fixing that please? Deploy's failing because of it.

Sure, I didn't ran eslint 😅 (time to configure github action for that maybe)

@chadstewart
Copy link
Collaborator

Hey @takanome-dev, looks like they're some ESLint rules that are causing errors. Do you mind fixing that please? Deploy's failing because of it.

Sure, I didn't ran eslint sweat_smile (time to configure github action for that maybe)

Yeah, I'm probably gonna make an issue and look into that in a bit, lol. I'm getting better at this!

@chadstewart
Copy link
Collaborator

@takanome-dev So I'm getting this error now:

Type error: 'homepage.cy.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.

Any idea what this is?

@takanome-dev
Copy link
Contributor Author

takanome-dev commented Feb 9, 2023

Type error: 'homepage.cy.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.

Since isolateModules is set to true in the tsconfig file, all implementation files must be modules (which means it has some form of import/export).
The cypress docs recommend to add another tsconfig file for the tests with different configs ✌️

@chadstewart
Copy link
Collaborator

Type error: 'homepage.cy.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.

Since isolateModules is set to true in the tsconfig file, all implementation files must be modules (which means it has some form of import/export). The cypress docs recommend to add another tsconfig file for the tests with different configs v

I don't think it worked, getting the same error. I'll also try messing around with this to try and get it to work. This is pretty new to me!

@takanome-dev
Copy link
Contributor Author

Oh sorry, I thought it was a lint error and it turns out that it was a build error. Should be good now 😄

@chadstewart
Copy link
Collaborator

Oh sorry, I thought it was a lint error and it turns out that it was a build error. Should be good now smile

Nah, it's cool. That did it!

I'll merge it in! This was definitely a fun PR! Definitely looking forward to digging into Cypress and Vitest some more!

@chadstewart chadstewart merged commit a692a78 into TechIsHiring:dev Feb 9, 2023
@chadstewart
Copy link
Collaborator

By the way, thanks so much for the contribution @takanome-dev and thanks for being the first ever outside contribution to this project!

@takanome-dev takanome-dev deleted the 29-add-test-infrastructure branch February 9, 2023 18:36
@takanome-dev
Copy link
Contributor Author

By the way, thanks so much for the contribution @takanome-dev and thanks for being the first ever outside contribution to this project!

Looking forward to contributing more to the project 🚀

@chadstewart
Copy link
Collaborator

By the way, thanks so much for the contribution @takanome-dev and thanks for being the first ever outside contribution to this project!

Looking forward to contributing more to the project 🚀

Yeah man! Feel free to look through the remaining open issues and let me know if you want yo take on anything else!

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.

Add Vitest, React Testing Library and Cypress
2 participants