Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix race condition in serverComponentsHmrCache tests (#70368)
fixes a race condition in the `after()`-related test in `server-components-hmr-cache.test.ts` i made `getLoggedAfterValue` stricter while investigating an unrelated issue, and saw it occasionally throw (see [CI run](https://github.com/vercel/next.js/actions/runs/11001754094/job/30547234764?pr=70362#step:29:708)). before this change, if `getLoggedAfterValue` was called before any logs with `"After: "` were written, it would just return `undefined`, which is obviously not what the test wants. this seems to have been happening occasionally, but it wasn't visible because even if we got `undefined` from one of the calls, the `expect(valueBeforePatch).not.toEqual(valueAfterPatch)` assertion would still pass -- one of the values is a string and the other is `undefined`, so obviously they're not equal!
- Loading branch information