-
Notifications
You must be signed in to change notification settings - Fork 269
test(theme): Add robust Jest/TS support and tests for theme components #1145
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
Open
sserrata
wants to merge
8
commits into
main
Choose a base branch
from
implement-theme-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
- Add tests for ArrayBrackets, SkeletonLoader, StatusCodes, and ApiLogo components - Mock Docusaurus and theme modules (@theme/ApiTabs, @theme/Details, etc.) via __mocks__ and manual Jest config mappings - Add @ts-ignore to theme imports in StatusCodes to bypass TS2307 errors - Add custom type declarations for theme mocks (src/theme-modules.d.ts) and update tsconfig.json for global recognition - Update jest.config.js for explicit moduleNameMapper entries and jsdom environment - Add setupTests.d.ts for jest-dom matchers and global test types - Ensure all new and updated files are included for proper TypeScript and Jest operation This enables reliable, isolated testing of theme components in docusaurus-theme-openapi-docs.
Size Change: 0 B Total Size: 2.13 MB ℹ️ View Unchanged
|
Visit the preview URL for this PR (updated for commit fce1254): https://docusaurus-openapi-36b86--pr1145-47ul77n7.web.app (expires Sun, 08 Jun 2025 16:23:16 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
…me component testing - Add ResizeObserver mock for Jest - Use manual mocks for @docusaurus/theme-common/internal with useScrollPositionBlocker - Apply // @ts-nocheck for TS module issues - Clean up test setup for reliable CI
…me component testing - Add ResizeObserver mock for Jest - Use manual mocks for @docusaurus/theme-common/internal with useScrollPositionBlocker - Apply // @ts-nocheck for TS module issues - Clean up test setup for reliable CI - Add and update all relevant mocks and config for Docusaurus theme testing
- Move ResizeObserver mock to setupTests.ts for global use - Ensure both setupFilesAfterEnv entries are loaded in Jest config - Remove redundant test file mocks - Add TESTING.md for contributor guidance - Re-add // @ts-nocheck to ApiTabs source for robust Docusaurus TS support
…d; add ts-nocheck for compatibility
…mitations, update testing docs, and clean up test setup
…d ts-nocheck workaround
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.
This enables reliable, isolated testing of theme components in docusaurus-theme-openapi-docs.
Description
Experimenting with using Windsurf to generate tests for theme components
Motivation and Context
Migrate tests to theme package to help with validation between changes
How Has This Been Tested?
yarn test packages/docusaurus-theme-openapi-docs/src/theme