Repository navigation
Conversation
…ing and improve development environment with nodejs-slim and npm
…with custom mocks
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for synapse-1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…rce install dependencies
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Contributor
There was a problem hiding this comment.
Copilot reviewed 9 out of 13 changed files in this pull request and generated no comments.
Files not reviewed (4)
- .direnv/flake-inputs/zd0x43g1jcav0xy0k6q9pdhy3bvif77n-source: Language not supported
- .direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa: Language not supported
- flake.nix: Language not supported
- package.json: Language not supported
Comments suppressed due to low confidence (1)
utils/ocr.test.ts:87
- Deleting global.window in this test may affect subsequent tests. Consider saving the original global.window value before deletion and restoring it in an afterEach block.
delete (global as any).window
Chere3
marked this pull request as draft
April 16, 2025 21:12
- Changed the test environment in jest.config.js to use 'jest-environment-jsdom'. - Added a new script for test coverage in package.json. - Updated pnpm-lock.yaml to include new dependencies for testing and coverage. - Modified GitHub Actions workflow to streamline coverage reporting and use pnpm for dependency management.
- Added a step in the GitHub Actions workflow to upload test coverage reports to Codecov. - Configured the Codecov action to use the coverage/lcov.info file and included necessary parameters for token and flags.
…rage - Modified the coverage.yml workflow to trigger on pushes and pull requests to the 'dev' branch instead of 'main'.
- Renamed the coverage job to build and updated the runner to ubuntu-22.04. - Enhanced the workflow by using actions/checkout@v4 and actions/setup-node@v4. - Added a step to install pnpm version 10 for dependency management. - Streamlined the Node.js version configuration using a matrix strategy.
- Changed the packageManager field in package.json to allow for a range of pnpm versions. - Enhanced the coverage.yml workflow by adding a token, flags, and a fail condition for the Codecov upload step.
- Updated the packageManager field in package.json to specify the exact pnpm version. - Modified the coverage.yml workflow to install pnpm version 10.9.0 for consistency.
This branch was successfully deployed
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.
This pull request introduces several changes to add testing capabilities, improve test coverage, and enhance the OCR utility functions. The most important changes include the addition of a GitHub Actions workflow for running tests and uploading coverage, modifications to the
package.jsonto include testing scripts and dependencies, and the implementation of comprehensive tests for the OCR utility functions.Testing and Coverage Enhancements:
.github/workflows/coverage.yml: Added a new GitHub Actions workflow to run tests and upload coverage results to Codecov. This includes steps for checking out the code, setting up Node, installing dependencies, running tests, and uploading the coverage results.package.json: Updated to include new test scripts (test,test:watch,test:ci) and added several testing-related dependencies such asjest,@testing-library/react, and@types/jest. [1] [2]jest.setup.js: Added setup for Jest, including mocking ofTextEncoder,TextDecoder, and several DOM methods to facilitate testing in a Node.js environment.OCR Utility Improvements:
utils/ocr.ts: Exported theconvertPdfToImagesfunction and improved error handling in theextractTextFromFilefunction to ensure that only instances ofErrorare thrown. [1] [2]utils/ocr.test.ts: Implemented comprehensive tests for the OCR utility functions, including mocking of dependencies liketesseract.jsandpdfjs-dist, and adding tests for various scenarios such as PDF to image conversion, text extraction from PDF and image files, and error handling.