-
Notifications
You must be signed in to change notification settings - Fork 3
Setup jest testing environment #146
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
Setup jest testing environment #146
Conversation
mocca102
commented
Jun 6, 2024
- Add jest tests github actions workflow
- Add npm dependencies
- Add jest setup and configuration
76b70e5 to
2627cec
Compare
2627cec to
747e914
Compare
VincentGalloro
left a comment
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 LGTM, if you want you can get a second 👀 on it
| "error" | ||
| "error", | ||
| { | ||
| "trailingComma": "es5" |
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.
Why are we changing this?
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.
Linting used to fail but it's not anymore. Removing it
jest.config.js
Outdated
| { | ||
| displayName: 'server', | ||
| testEnvironment: 'node', | ||
| testMatch: ['**/**/*.server.test.(js|jsx)'], |
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.
Do we care about ts/tsx file here?
| @@ -0,0 +1,8 @@ | |||
| class IntersectionObserver { | |||
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.
We have failOnConsole on the Quizzes UI equivalent of this file. I don't think we have to have it but it might be useful?
https://github.com/Constructor-io/constructorio-ui-quizzes/blob/main/jest.setup.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.
Thank you I didn't know I needed this but it will make testing easier for the other PR. Adding it
| @@ -0,0 +1,20 @@ | |||
| import React from 'react'; | |||
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.
Not a big deal but why jsx and not tsx?
esezen
left a comment
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.
LGTM!