Type check tests#586
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens the TypeScript quality gate by ensuring unit tests and Cypress code are type-checked, while also resolving SVG module typing conflicts by aligning the project’s .svg imports with the existing @svgr/webpack setup in a Next.js App Router codebase.
Changes:
- Type-check Jest test files and add a dedicated
cypress/tsconfig.json, updating thetscscript to type-check both the app and Cypress. - Align SVG TypeScript declarations with
@svgr/webpackand disable Next static image imports to avoid conflicting ambient*.svgtypings. - Simplify multiple Jest tests by removing redundant per-file setup/mocks and relying on the shared Jest setup.
Reviewed changes
Copilot reviewed 15 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| types/svg.d.ts | Updates *.svg typing so default imports are React components (SVGR-aligned). |
| tsconfig.json | Stops excluding .test.* files so Jest tests are type-checked; excludes Cypress from the root project. |
| src/components/Stars/StarsBackground.test.tsx | Switches to jest.requireMock and removes redundant setup import. |
| src/components/publications/Publications.test.tsx | Removes redundant jest-dom import and in-test Next Link mock. |
| src/components/projects/ProjectsGrid.test.tsx | Removes redundant jest-dom import and in-test Next Link mock. |
| src/components/navbar/Navbar.test.tsx | Removes redundant imports and in-test Next Link/Image mocks; keeps pathname mocking. |
| src/components/footer/Footer.test.tsx | Removes redundant jest-dom import and in-test Next Link mock. |
| src/components/cookie-snackbar/CookieSnackbar.test.tsx | Removes redundant jest-dom import. |
| src/components/banner/Banner.test.tsx | Removes redundant jest-dom import. |
| src/components/banner/Avatar.test.tsx | Simplifies test setup and updates assertion to account for next/image src rewriting. |
| src/app/not-found.test.tsx | Removes redundant jest-dom import. |
| src/app/loading.test.tsx | Removes redundant jest-dom import. |
| package.json | Updates tsc to also run tsc -p cypress/tsconfig.json and bumps dependency versions. |
| next.config.js | Disables static image imports to avoid conflicting ambient *.svg typing; documents SVGR handling. |
| next-env.d.ts | Removes next/image-types/global reference to match disabled static image imports. |
| docs/usage/testing.md | Updates testing docs to reflect new npm run tsc behavior and links to Cypress files. |
| cypress/tsconfig.json | Adds Cypress-specific TS project for type-checking Cypress specs/config. |
| .prettierignore | Ignores Python .mypy_cache. |
| .markdownlintignore | Ignores Python .mypy_cache. |
| .gitignore | Ignores Python .mypy_cache and normalizes .nx/cache entry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.