Skip to content

expo-asset is required by expo-font but never declared — blocks the last mobile test suite #689

Description

@Miracle656

Problem

components/__tests__/QuickActions.test.tsx fails to run:

FAIL components/__tests__/QuickActions.test.tsx
  Cannot find module 'expo-asset' from 'node_modules/expo-font/build/FontLoader.js'

expo-font/build/FontLoader.js requires expo-asset at runtime, but expo-font declares it in neither dependencies nor peerDependencies:

expo-font deps:  {"fontfaceobserver":"^2.1.0"}
expo-font peer:  {"expo":"*","react":"*","react-native":"*"}

frontend/mobile/package.json doesn't declare it either, and it is absent from node_modules after a clean npm ci. So nothing installs it and the require fails.

Why now

After #686 fixed the AsyncStorage mock, the mobile suite went from 10 failing suites to 1:

before #686   Test Suites: 10 failed, 19 passed, 29 total   Tests: 347 passed
after  #686   Test Suites:  1 failed, 28 passed, 29 total   Tests: 420 passed

Confirmed identically in CI and locally. This is the only thing left keeping Mobile — typecheck & test red.

That matters more than one suite: the job has been red on main for weeks, and PRs have been merged after establishing the red was pre-existing. A permanently-red required check trains everyone to ignore it, which is how a real failure eventually lands. Fixing this turns the check back into a signal.

What to build

Add expo-asset as a direct dependency of frontend/mobile, at the version matching the installed Expo SDK.

Suggested execution

  1. npx expo install expo-asset — use expo install, not plain npm install, so the version is pinned to the SDK's compatible range rather than latest.
  2. Confirm npx jest components/__tests__/QuickActions.test.tsx passes.
  3. Run the full suite and confirm 29/29 suites pass.
  4. Sanity-check the app still starts (npx expo start) — this adds a real package, not just a test shim.

Acceptance criteria

  • expo-asset is declared in frontend/mobile/package.json at an SDK-compatible version
  • npm ci && npx jest passes with 0 failing suites — paste the summary line
  • Mobile — typecheck & test is green on the PR (this is the point of the issue; a green local run isn't sufficient evidence)
  • The lockfile is committed and consistent

Notes

  • frontend/mobile uses plain npm. Do not use --legacy-peer-deps — it corrupts the lockfile in this workspace.
  • Do not "fix" this by mocking expo-asset in jest.setup.js. The module is genuinely required by a package we ship; the missing dependency is the bug, and mocking it would hide a real gap that could bite at runtime.

Drips Wave · Complexity: Easy · 100 points


Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveDrips Wave program issuearea:testsTesting and coveragebugSomething isn't workingdifficulty:easy~1-3 hourshelp wantedExtra attention is neededmobileVeil mobile apppoints:100Easy tier — 100 Wave points

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions