The situation:

Importing fastly:secret-store (or other fastly: namespaced modules) fails under Jest with Cannot find module 'fastly:secret-store' even though the app builds and deploys fine. Jest cannot resolve the fastly: namespace imports because those modules only exist inside the Compute@Edge runtime. Maintainers from Fastly recommend using the community jest preset ysugimoto/jest-preset-fastly-js-compute, which maps the fastly: imports to local mocks; the maintainer explicitly called it the exact integration they recommend for Fastly JS apps under Jest. The reporter confirmed that PR 9 on that preset resolved their issue and the thread was closed.

What actually fixes it (verified in the thread):

Use the jest preset ysugimoto/jest-preset-fastly-js-compute in your jest config: it maps fastly: namespaced imports to local mocks so tests can run outside the Compute@Edge runtime. This is the integration Fastly's own maintainer recommends for Jest users, and the reporter confirmed that a preset update (PR 9) fixed their failing tests. Source: https://github.com/fastly/js-compute-runtime/issues/597