Fix Vitest Test Environment and Health Monitor Runtime Errors#37
Fix Vitest Test Environment and Health Monitor Runtime Errors#37daggerstuff wants to merge 4 commits intostagingfrom
Conversation
- Corrected path aliases in `config/vitest.config.ts` to use relative paths (`../src`) - Moved CI thread configuration out of `poolOptions` for Vitest compatibility - Fixed runtime reference errors (`_error`, `_String`) in `src/lib/services/health-monitor.ts` - Created `vitest.setup.ts` in root with `TextEncoder`, `TextDecoder`, and `fetch` mocks - Set default test environment variables (`ENCRYPTION_KEY`, `PUBLIC_URL`) in setup file These changes ensure that `pnpm test:unit` can successfully load and execute the test suite. Co-authored-by: daggerstuff <261005129+daggerstuff@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Corrected path aliases and setup file references in `config/vitest.config.ts` to use proper relative paths (`../`) - Moved CI thread configuration to top-level `test` object for Vitest version compatibility - Fixed syntax errors in `src/lib/services/health-monitor.ts` (`_error` -> `error`, `_String` -> `String`) - Created `vitest.setup.ts` in root with required `TextEncoder`, `TextDecoder`, and `fetch` mocks - Resolved CodeQL CI failures by fixing malformed `qlpack.yml` and hardening workflow configuration - Transitioned CodeQL config to use the `packs` key for better language-specific analysis control - Removed deprecated `setup-python-dependencies` from CodeQL workflow Co-authored-by: daggerstuff <261005129+daggerstuff@users.noreply.github.com>
- Resolved Vitest environment issues by correcting path aliases and setup file references in `config/vitest.config.ts`. - Implemented `vitest.setup.ts` to provide necessary `TextEncoder`, `TextDecoder`, and `fetch` mocks for JSDOM. - Fixed critical syntax errors in `src/lib/services/health-monitor.ts` that caused runtime crashes. - Resolved CodeQL CI failures: - Fixed "Cannot deserialize" error by removing invalid `suites` block in `qlpack.yml`. - Fixed "package without scope" error by removing incorrect `packs` section in `codeql-config.yml`. - Fixed "invalid package specification" in Python jobs by implementing robust conditional query loading in the workflow. - Streamlined `queries` configuration to correctly load standard suites and custom JavaScript-specific queries. - Removed deprecated `setup-python-dependencies` from the CodeQL workflow. These changes ensure the CI pipeline completes successfully and the unit test suite correctly initializes and executes. Co-authored-by: daggerstuff <261005129+daggerstuff@users.noreply.github.com>
- Synchronized `PNPM_VERSION` to `10.30.1` across all GitHub workflows to match `package.json`. - Resolved Vitest environment issues by correcting relative path aliases and setup file references in `config/vitest.config.ts`. - Implemented `vitest.setup.ts` with required `TextEncoder`, `TextDecoder`, and `fetch` mocks for JSDOM stability. - Fixed critical syntax and reference errors in `src/lib/services/health-monitor.ts` (`_error` -> `error`, `_String` -> `String`). - Resolved CodeQL CI failures: - Removed malformed `suites` from `qlpack.yml` and incorrect `packs` from `codeql-config.yml`. - Implemented robust conditional loading of custom queries in the CodeQL workflow to prevent failures in Python analysis jobs. - Corrected query suite specification format to avoid "invalid package specification" errors. These changes stabilize the CI pipeline, ensure correct security analysis across languages, and allow the unit test suite to execute successfully. Co-authored-by: daggerstuff <261005129+daggerstuff@users.noreply.github.com>
This PR fixes several issues that were preventing the unit test suite from running:
TextEncoder,TextDecoder, andfetchwhich were missing in the test environment.HealthMonitorhad invalid variable references in catch blocks.ENCRYPTION_KEYwere missing during test execution.After these changes,
pnpm test:unitexecutes correctly.PR created automatically by Jules for task 13398122599881524459 started by @daggerstuff