Add jest setup for site - #395
Conversation
6405046 to
78b1d4b
Compare
|
Do you have a real world example for a site test? |
johnnyomair
left a comment
There was a problem hiding this comment.
The tests aren't run in the test workflow. Could you please fix this? Thanks!
| "@graphql-codegen/typescript": "^2.0.0", | ||
| "@graphql-codegen/typescript-operations": "^2.0.0", | ||
| "@testing-library/jest-dom": "^6.5.0", | ||
| "@testing-library/react": "^16.0.1", |
There was a problem hiding this comment.
Should we add an example usage for testing library as well?
There was a problem hiding this comment.
Sure. Added tests for HiddenIfInvalidLink.tsx. ae2b484
| testEnvironment: "jsdom", | ||
| setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"], | ||
| // Add more setup options before each test is run | ||
| // setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'], |
There was a problem hiding this comment.
This option is defined two lines above 😁 IMO we can remove all comments here
There was a problem hiding this comment.
I'm not sure if we should add a tests folder for this.
There was a problem hiding this comment.
I prefer splitting tests and application code, but I can remove the __test__ folder when you don't like it.
What do you mean? I wrote tests for HiddenIfInvalidLink. |
I'm just curious and wanted to know what are you testing (or plan) in actual projects. |
We'll probably have few tests in the site in projects. I can think of some use cases for sites with more business logic, e.g., with an integrated shop. But it doesn't hurt to have the setup IMO. We could discuss whether we should have example tests as well. |
I'd like to see them :) (we should move this discussion into our slack) |
|
Will be replaced by vivid-planet/dextinity#6289 |
No description provided.