Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Dec 9, 2025

Summary

  • Fix type errors in stackone.mcp-fetch.spec.ts by removing obsolete stackOneClient references
  • Ensure CI properly fails when type checking or tests fail by removing --no-bail flag
  • Document vitest globals usage in testing skill documentation

Problem

CI was passing despite type errors because pnpm --no-bail causes the command to exit with code 0 even when scripts fail. The type errors were caused by using stackOneClient property which no longer exists after the RPC client refactor.

Changes

Test File (src/tests/stackone.mcp-fetch.spec.ts)

  • Remove @stackone/stackone-client-ts import (package no longer used)
  • Remove vitest import (globals are enabled)
  • Remove stackOneClient mock objects from all test configurations
  • Remove RPC execution assertions that relied on injected client

CI Scripts (package.json)

  • Remove --no-bail from test and typecheck scripts
  • Retain --aggregate-output for grouped output display

Documentation (.claude/skills/typescript-testing/SKILL.md)

  • Add section about vitest globals being enabled
  • Clarify that imports from 'vitest' are unnecessary

Related 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 typecheck passes without errors
  • pnpm test:root passes
  • CI now properly fails on type errors (verified by removing --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.

  • Bug Fixes
    • Removed @stackone/stackone-client-ts imports and stackOneClient mocks from tests.
    • Dropped --no-bail from test and typecheck scripts; kept --aggregate-output.

Written for commit d526610. Summary will update automatically on new commits.

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).
@ryoppippi ryoppippi requested a review from a team as a code owner December 9, 2025 12:49
Copilot AI review requested due to automatic review settings December 9, 2025 12:49
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 9, 2025

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@175

commit: d526610

Copy link

Copilot AI left a 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 stackOneClient injection 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.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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

@ryoppippi ryoppippi merged commit 4d465bf into main Dec 9, 2025
17 checks passed
@ryoppippi ryoppippi deleted the fix/typecheck-errors-and-ci-bail branch December 9, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants