-
Notifications
You must be signed in to change notification settings - Fork 8
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
chore(repo): add Vitest into codebase #57
chore(repo): add Vitest into codebase #57
Conversation
✅ Deploy Preview for cuhacking-portal-test-deployment ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
eslint.config.mjs
Outdated
@@ -8,5 +8,6 @@ export default antfu( | |||
}, | |||
{ | |||
...playwright.configs['flat/recommended'], | |||
ignores: ['tests/unit-tests/**/*.ts'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aware this is causing a build failure. Let me know how to go about this if you have any advice. Currently looking into a solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property doesn't exist for eslint-plugin-playwright.
Were the playwright ESLint rules causing issues with Vitest tests?
Also never push commits or make changes that break builds or tests into a PR, use a draft PR instead if you need discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep working on fixing it currently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't fix it, commented it out altogether for now. The E2E tests will be in a separate directory in the monorepo so we won't have conflicting configs anyways. Monorepo management tools handle a lot of these config headaches for you.
The branch for this is currently Sometimes which type to apply can be ambiguous, so use your best judgement, can always be changed later. If it's getting ambiguous, it's also a good sign to split the issue into separate smaller issues to separate concerns. The issue title should specify both the branch name and the PR title. The issue title should also be in imperative tense, so Just like there's a commit history.... There's also branching history.... Adhering to conventional spec also allows you to switch between branches easier when multi-tasking, so you can take better advantage of the distributed nature of Git. You know whose branch it is and can contact them, know the category of work to have better context, and also what the specific task is. People looking at the list of issues can also better make out what to do. So for example this: Could be Since it's not a huge task, it could just be a feature issue instead. ADRs are for like big project decisions like what tech to use, what philosophy to adapt, etc. No need to change the branch for this time. Just a note for the future, this comment can also be sent as a link to others in case this happens again. |
Thanks for the advice on this, just completely missed my brain to add the spec, nothing wrong with the docs on that one. I renamed the other issue to be clearer 👍 |
All good all good we're learning |
In your So we eventually end up the following: You can see the You can tell it was e2e tests. This will not scale. Hence why e2e tests are split into a separate app in our upcoming monorepo architecture as they do need maintenance and can grow into a significant amount of code. For now let's leave the |
d0ba7aa
to
848bdcf
Compare
Would unit-tests and integrations also be their own app? |
Depends on scale. Your unit and integration test suites should be co-located with your app. They generally don't take too long to run, but have the highest maintenance cost. If your unit and integration tests are big enough to warrant being separated, your app should be split up/re-architected instead. E2E tests take a while and have the lowest maintenance cost. They should also be completely black-boxed from your main app, knowing absolutely nothing about it. Hence why it gets its own directory. |
848bdcf
to
03a5c12
Compare
run: bun install | ||
|
||
- name: 💀 Run Unit Tests | ||
run: bun run test:vitest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure we run test:unit
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing some important work and can't stash, feel free to change this and force push
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you want you keep the commands generic, makes mass migrations much easier. So the script for test:unit
could use Jest in the future if necessary. We don't have to change all our stuff from test:vitest
to test:jest
.
Looks good, as well as Farabi's comments here. Awaiting permissions on the deployment, I would be happy to take a chance at fixing the pipelines. |
Describe The Outcome
Dependency Changes
Context
Essential for following Test Driven Development philosophies.
closes #44