Files
Hendrik LiebauandGitHub c3d5b92778 [test] Move the dev-only use cache test suite to test/development (#96023)
The `use-cache-dev` suite only covers dev-mode HMR behavior of `use
cache`, so it belongs under `test/development/app-dir` alongside the
other `cache-components-dev-*` suites rather than in `test/e2e`. Because
`test/development` runs only in dev mode and is never deployed, the
production-mode placeholder guard, the `skipDeployment` option, and the
`if (skipped)` early return are all dropped. The three test manifests
that referenced the old path are updated.


---

<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
2026-07-22 15:50:22 +02:00

17 lines
508 B
TypeScript

async function getCachedData() {
'use cache'
return { text: 'foo', mathRandom: Math.random() }
}
export async function GET() {
const { text, mathRandom } = await getCachedData()
// Read outside of "use cache" so it reflects the recompiled module on every
// request. This lets the test distinguish a stale cache hit (where `text`
// keeps its old value) from the module never having recompiled at all.
const uncachedText = 'foo'
return Response.json({ text, mathRandom, uncachedText })
}