MCPcopy Create free account
hub / github.com/activejs/activejs / dispatchRandomValues

Function dispatchRandomValues

packages/core/src/tests/async-system.spec.ts:172–182  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170 let pendingUnitEmitCount: number;
171
172 const dispatchRandomValues = (): number => {
173 const someUnits = randomSelectMultiple([queryUnit, dataUnit, errorUnit, pendingUnit]);
174 return someUnits
175 .map(unit => {
176 const shouldDispatchDuplicate = randomBoolean();
177 return unit.dispatch(shouldDispatchDuplicate ? unit.value() : randomValidValue(unit), {
178 bypassDebounce: true,
179 });
180 })
181 .filter(didDispatch => didDispatch).length;
182 };
183
184 beforeEach(() => {
185 Configuration.reset();

Callers 1

Calls 5

randomSelectMultipleFunction · 0.90
randomBooleanFunction · 0.90
randomValidValueFunction · 0.90
dispatchMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected