Skip to content

fix(embed): mock @audius/sdk virtually in BedtimeClient test - #14611

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/embed-test-sdk-resolution
Sep 24, 2026
Merged

dylanjeffers merged 1 commit into
mainfrom
fix/embed-test-sdk-resolution

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Embed Deploy has failed on main since #14604 added a Verify embed step that runs jest before Build embed. When jest mocks a module with a factory, it still resolves the real module. @audius/sdk points at dist/, which doesn't exist until the build runs:

Cannot find module '@audius/sdk' from 'src/util/BedtimeClient.test.js'

Marking the mock { virtual: true } skips that resolution. I reproduced locally with an unbuilt @audius/sdk stub: the test fails the same way before this change and passes 3/3 after.

🤖 Generated with Claude Code

The Embed Deploy job now runs jest before building, so @audius/sdk has
no dist and jest can't resolve the module it's mocking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: be1fc09

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dylanjeffers
dylanjeffers merged commit edb4e5d into main Sep 24, 2026
18 checks passed
@dylanjeffers
dylanjeffers deleted the fix/embed-test-sdk-resolution branch September 24, 2026 21:31
dylanjeffers added a commit that referenced this pull request Sep 24, 2026
…#14612)

Follow-up to #14611. The jest test now passes in the Embed Deploy job
([run
36062074996](https://github.com/AudiusProject/apps/actions/runs/36062074996)),
but `npm run verify` in the same step still fails:

- `dotenv-linter: not found`: the binary is downloaded by the package's
`install` script into `packages/dotenv-linter/bin`, which isn't in the
node_modules cache, and the job only runs `rebuild --ignore-scripts`.
I've added the same missing-binary check `mobile.yml` uses.
- eslint `import/no-unresolved` for `@audius/harmony`, `@audius/sdk` and
`@audius/fixed-decimal`: their `dist/` isn't built yet. I've added
`turbo run build --filter='embed^...'`, the same step `embed.yml` runs.
`build:prod` afterwards reuses the turbo cache.

This job only runs on main pushes, so it can't be exercised from the PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant