Skip to content

fix: update User test mocks for @workos-inc/node 10.4.0 (unblock publish)#110

Merged
nicknisi merged 1 commit into
mainfrom
fix/unblock-publish-typecheck
Jun 24, 2026
Merged

fix: update User test mocks for @workos-inc/node 10.4.0 (unblock publish)#110
nicknisi merged 1 commit into
mainfrom
fix/unblock-publish-typecheck

Conversation

@nicknisi

Copy link
Copy Markdown
Member

Summary

0.10.0 was tagged by release-please but failed to publish to npm (failed run). The Publish job runs prepublishOnly, which includes typecheck (tsc --noEmit, root tsconfig.jsonincludes spec files), and it errored on two stale User mocks.

Root cause

#107 (fix!: require @workos-inc/node >=10.4.0) pulled in a node SDK where User.name (string | null) is required. Two test mocks predate that and omit name:

  • src/client/AuthKitProvider.spec.tsx
  • src/client/useAccessToken.spec.tsx

PR CI only runs build (tsc -p tsconfig.build.json, which excludes specs), so the error never surfaced on any PR — it only fired at publish time, leaving 0.10.0 tagged in git but absent from npm.

Fix

Add the required name field to both User mocks. No runtime/source change.

Verification

  • pnpm run typecheck (root — the exact gate publish runs): clean
  • pnpm run test: 236 passing · format:check clean · lint clean

Recommended follow-up (separate)

Add a Typecheck step to ci.yml so spec-only type errors are caught in PR CI rather than at publish (parity with authkit-nextjs, whose ci.yml already runs typecheck):

      - name: Typecheck
        run: |
          pnpm run typecheck

I left this out of this PR (the workflow edit tripped a security guard, and it's cleanly separable from the release-unblock fix). Worth adding so this class of failure can't reach publish again.

Re-publishing

A re-run of the failed job won't republish 0.10.0 (release-please won't re-tag it). Merging this fix: will have release-please cut 0.10.1, and that release's publish job will run with the fix included.

The @workos-inc/node 10.4.0 bump (#107) made `User.name` a required field, but the User mocks in AuthKitProvider.spec.tsx and useAccessToken.spec.tsx were not updated. The publish job runs prepublishOnly -> typecheck (root tsconfig, which includes spec files), so it failed and 0.10.0 was tagged but never published to npm.

PR CI only runs build via tsconfig.build.json (which excludes specs), so it never caught this. Add the missing name field to both mocks to restore a publishable build.

Follow-up: add a `pnpm run typecheck` step to ci.yml so spec-only type errors are caught in PR CI instead of at publish time (parity with authkit-nextjs).

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@nicknisi nicknisi requested a review from gjtorikian June 24, 2026 20:21
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates test user mocks to match the current WorkOS user type. The main changes are:

  • Adds the required name field to the AuthKitProvider test mock.
  • Adds the required name field to the useAccessToken test mock.
  • Keeps the change limited to spec files with no runtime source changes.

Confidence Score: 5/5

Safe to merge; the changes are limited to test mocks and align them with the required WorkOS user shape.

The diff only updates spec fixtures by adding the missing required field, with no runtime source changes.

T-Rex T-Rex Logs

What T-Rex did

  • Ran pnpm run typecheck on the base branch and it failed with exit code 2 and TypeScript diagnostics (TS2741) for missing required name in User mocks in src/client/AuthKitProvider.spec.tsx and src/client/useAccessToken.spec.tsx.
  • Ran pnpm run typecheck on the head and it completed with exit code 0 and no TypeScript diagnostics.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix: update User test mocks for @workos-..." | Re-trigger Greptile

@nicknisi nicknisi merged commit 4d91303 into main Jun 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants