-
Notifications
You must be signed in to change notification settings - Fork 3
fix: resolve type errors and ensure CI fails on errors #175
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
Conversation
Remove references to the non-existent stackOneClient property that was causing type errors. The property was part of an old API that no longer exists after the RPC client refactor (commit 53bce87). Changes: - Remove @stackone/stackone-client-ts import (package no longer used) - Remove vitest import (globals are enabled, no import needed) - Remove stackOneClient mock objects from all test configurations - Remove RPC execution assertions that relied on injected client The tests remain skipped (describe.skip) as they require Bun runtime.
Remove --no-bail flag from test and typecheck scripts. According to pnpm documentation, --no-bail causes the command to exit with code 0 even if scripts fail, which was allowing CI to pass despite type errors. This change ensures CI properly fails when: - Type checking encounters errors - Tests fail The --aggregate-output flag is retained to show all output together.
Add documentation about vitest globals being enabled in the project. Developers should NOT import from 'vitest' as describe, it, expect, vi, assert, and other test utilities are available globally. This prevents unnecessary imports and aligns with project configuration (globals: true in vitest.config.ts).
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes type errors caused by obsolete stackOneClient references and ensures CI properly fails on type checking or test errors by removing the --no-bail flag from pnpm scripts.
- Removes all references to the deprecated
stackOneClientinjection pattern in tests - Updates CI scripts to properly propagate failure exit codes
- Documents vitest globals configuration to prevent unnecessary imports
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/tests/stackone.mcp-fetch.spec.ts |
Removes obsolete @stackone/stackone-client-ts imports and stackOneClient mock objects that are no longer needed after the RPC client refactor |
package.json |
Removes --no-bail flag from test and typecheck scripts to ensure CI fails properly when errors occur |
.claude/skills/typescript-testing/SKILL.md |
Documents that vitest globals are enabled, clarifying that imports from 'vitest' are unnecessary for common test utilities |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 3 files
Summary
stackone.mcp-fetch.spec.tsby removing obsoletestackOneClientreferences--no-bailflagProblem
CI was passing despite type errors because
pnpm --no-bailcauses the command to exit with code 0 even when scripts fail. The type errors were caused by usingstackOneClientproperty which no longer exists after the RPC client refactor.Changes
Test File (
src/tests/stackone.mcp-fetch.spec.ts)@stackone/stackone-client-tsimport (package no longer used)vitestimport (globals are enabled)stackOneClientmock objects from all test configurationsCI Scripts (
package.json)--no-bailfromtestandtypecheckscripts--aggregate-outputfor grouped output displayDocumentation (
.claude/skills/typescript-testing/SKILL.md)'vitest'are unnecessaryRelated Issues
Related to #170 - This PR removes vi.fn() mocks and type assertions as part of the refactoring effort. The tests remain skipped pending full MSW migration.
Test Plan
pnpm typecheckpasses without errorspnpm test:rootpasses--no-bail)Summary by cubic
Fixes MCP fetch test type errors by removing obsolete stackOneClient references and RPC assertions. CI now fails on typecheck/test errors by dropping --no-bail; docs note Vitest globals, aligning with #170.
Written for commit d526610. Summary will update automatically on new commits.