Reactivity
Subset of Solid's reactive utilities used by Circuit to load nested hierarchical data.
Test Utils
Some test-related utils are exported from the test-utils entrypoint.
import {
waitLoadedAccessor,
waitSignal,
spySignal,
} from '@circuit/reactivity/test-utils'
-
waitSignal(signal, condition) is a function that returns a promise that resolves when the given LoadableSignal is called and the given condition is met.
-
waitLoadedAccessor(signal) is a function that returns a promise that resolves when the given LoadableAccessor is loaded. This is useful when you want to guarantee that a test is waiting for an LoadableAccessor to be loaded.
-
spySignal(signal) is a function that returns a jest.Mock that is spying on the given LoadableAccessor. This is useful when you want to verify that a signal has been called after any of its dependencies were updated.