-
Notifications
You must be signed in to change notification settings - Fork 36
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
Next #533
Merged
Merged
Next #533
Conversation
This file contains 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
- **vite.config.ts**: Added Vitest configuration for testing, global enabled, jsdom environment, setup file, and coverage provider set to v8. - **tsconfig.json & tsconfig.app.json**: Included Vitest and Testing Library types for type-checking. - **package.json**: Added Vitest scripts (`test` and `test:coverage`), along with dependencies for Vitest, Testing Library, and related tooling. - **setupTest.ts**: Added setup file to extend `expect` with Testing Library matchers.
- Added `modal.test.tsx` with tests to validate Modal behavior: - Ensures component matches the snapshot. - Confirms the title is displayed when `open` is true. - Verifies the title is absent when `open` is false. - Created a snapshot file `modal.test.tsx.snap`. - Exported `ModalProps` in `modal.tsx` to enable type usage in tests.
- Removed direct import of '@testing-library/jest-dom'. - Updated to use matchers from '@testing-library/jest-dom/matchers'. - Ensures consistency in imports and aligns with testing setup best practices.
- Removed unused `MemoryRouter` from `modal.test.tsx`. - Updated snapshot-related test case to use `baseElement` for clarity. - Added new test cases: - Verify modal content rendering. - Verify `onClose` prop is called when modal is closed. - Revised and improved existing test case descriptions for readability. - Deleted stale snapshot file `modal.test.tsx.snap`.
- Replace "make test" with "npm run test" in `.github/workflows/ci.yml`. - Ensures consistency by aligning the test task with npm scripts. - Improves clarity and uniformity in the CI process.
- Updated `.github/workflows/ci.yml`: - Modified the "Test" step to include coverage by running `npm run test -- --coverage`.
- Created a new snapshot file `modal.test.tsx.snap` under `src/components/test/__snapshots__`. - Captures the rendered structure of the modal component to ensure consistent UI updates.
- Updated `.github/workflows/ci.yml`: - Added a step to cache Node.js dependencies using `actions/cache@v4`. - Configured cache key based on `package-lock.json` hash for efficient reuse. This change aims to speed up CI runs and reduce redundant package installations.
- Updated the test command in `.github/workflows/ci.yml` to include the `--silent` flag for cleaner output. - Commented out the "Generate report" step to disable its execution for now.
- Deleted the "Cache Node dependencies" step in `.github/workflows/ci.yml`. - Rationale: Simplifies the workflow as caching is not necessary for the current setup. ```
# Conflicts: # .github/workflows/ci.yml
- Updated `.github/workflows/ci.yml` to include the `--coverage` flag when running tests. - This ensures test coverage data is generated and can be uploaded to Codecov for better analysis.
- Updated `.github/workflows/ci.yml`: - Split the "Test" step into two separate steps: one for running tests (`npm run test`) and another for coverage generation (`npm run test:coverage`). - Ensures more granular execution and better step visibility in CI pipelines.
- Removed redundant "Coverage" step from `.github/workflows/ci.yml`. - Ensured `test:coverage` is run only once during the CI process. - Improved clarity and reduced duplication in the workflow configuration.
- Updated `.github/workflows/ci.yml`: - Replaced `codecov-action@v5` with `codecov-action@v4`. - Commented out unused `token` and `slug` parameters. This ensures compatibility and simplifies configuration.
- Updated `.github/workflows/ci.yml`: - Un-commented `token` and `slug` parameters in Codecov action to enable coverage report uploads.
test: setup base for unit testing using vitest
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #533 +/- ##
======================================
Coverage ? 0.03%
======================================
Files ? 557
Lines ? 30734
Branches ? 557
======================================
Hits ? 11
Misses ? 30167
Partials ? 556 ☔ View full report in Codecov by Sentry. |
|
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.