Unify serverAct helpers (#33327)

This uses the richer `serverAct` helper that we already use in other
tests.

This avoids using the `Scheduler`. We don't use that package on the
server so it doesn't make sense to simulate going through it.
Additionally, we really should be getting rid of it on the client too to
favor `postTask` polyfills.
This commit is contained in:
Sebastian Markbåge
2025-05-21 16:13:54 -04:00
committed by GitHub
parent 1835b3f7d9
commit 1c43d0aed7
18 changed files with 94 additions and 255 deletions

View File

@@ -1,13 +1,7 @@
'use strict';
export function patchSetImmediate(Scheduler) {
if (!Scheduler) {
throw new Error(
'setImmediate patch was used without providing a Scheduler implementation. If you are patching setImmediate you must provide a Scheduler.'
);
}
export function patchSetImmediate() {
global.setImmediate = cb => {
Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, cb);
setTimeout(cb, 0);
};
}