Fix server Jest test structure and standardize test scripts#5909
Fix server Jest test structure and standardize test scripts#5909
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the server package's Jest testing setup to resolve test discovery issues. It standardizes the test execution commands in Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces significant improvements to the test infrastructure for the server package. The core change involves refactoring the test structure to allow Jest to auto-discover and run test files individually, which is a more standard and scalable approach. This was achieved by removing the single, monolithic test entry point (test/index.test.ts) that contained problematic practices like a long, hardcoded wait time. The test scripts in package.json have been standardized, removing flags that can mask issues (like --forceExit) and adding common scripts for watch mode and coverage. The existing test files have been updated to be standalone, completing the transition to a modern Jest setup. These changes effectively resolve the test discovery issues and create a more robust and efficient testing environment.
| - run: pnpm build | ||
| env: | ||
| NODE_OPTIONS: '--max_old_space_size=4096' | ||
| - run: pnpm test:coverage |
There was a problem hiding this comment.
are we still running integration test for server? if it's unit test we shouldn't need to depend on build
This PR fixes Jest test discovery issues in the server package.
pnpm install && pnpm lint-fix && pnpm build-force && pnpm test
pnpm install && pnpm lint-fix && pnpm build-force && pnpm test:coverage