Repository navigation
test(signals): repair type checks and async regression coverage - #3781
Conversation
Preserve refreshable accessor types, instantiate deferred gates, and fix imports and call signatures used by the existing regression tests. Keep deliberately invalid callbacks at an explicit runtime-test boundary and keep optional fixture properties absent at runtime. No production, configuration or dependency changes.
The L2 scheduler no longer exposes activeTransition. Reading that missing property made the old condition pass without observing the intended completion window. Await the action while holding scheduler microtasks, inject the operation, then release the flush. Assert the ordering and restore the mock even when an action stalls until the test timeout. All four regressions reject a mutation that flushes before the operation.
Pass the error handler in the effect bundle and assert the received error while retaining the memo's throwing read. Capture the effect owner in the compute phase so the GC regression observes a valid weak target. The seven explicit-GC tests pass. With the related fixture and action test repairs, the test-inclusive TypeScript check has zero diagnostics and the full Signals suite passes 4,892 tests.
|
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
The test-inclusive Signals TypeScript check reports 78 diagnostics on
next. Several tests also stopped observing the behavior their names describe: action tests read the removedactiveTransitionproperty, a stream error handler is passed in the wrong argument, and the effect GC test constructs aWeakReffrom the imperative phase's null owner.This updates 31 test files without changing production code, configuration or dependencies. The commits separate fixture types and signatures, action completion ordering, and error/GC observations. Deliberately invalid calls remain invalid at runtime, and optional fixture keys remain absent.
How did you test this change?
node node_modules/typescript/bin/tsc --noEmit -p packages/signals/tsconfig.json --pretty false: zero diagnostics, down from 78 on the base.pnpm --filter @solidjs/signals exec vitest run tests/gc.test.ts --pool forks --execArgv=--expose-gc --configLoader runner --no-cache: 7 passed.--maxWorkers 4: 4,892 passed, 2 expected failures, 2 skipped across 256 files.git diff --checkpassed.An initial full-suite run hit a timing-sensitive refetch failure. That unchanged test passed on both the base and patched checkout in isolation, and the final complete run passed with four workers. Its assertions and timeouts were left unchanged.