MCPcopy Create free account
hub / github.com/ReactiveX/rxjs / expectSubscriptions

Method expectSubscriptions

packages/test/src/assertions.ts:169–187  ·  view source on GitHub ↗
(actual: readonly TestSubscriptionLog[])

Source from the content-addressed store, hash-verified

167 }
168
169 expectSubscriptions(actual: readonly TestSubscriptionLog[]): SubscriptionExpectation {
170 const assertion: SubscriptionAssertion = {
171 kind: 'subscriptions',
172 actual,
173 matched: false,
174 evaluated: false,
175 };
176 this.#assertions.push(assertion);
177 return {
178 toBe: (marbles: string | readonly string[]): void => {
179 this.#setMatcher(assertion);
180 assertion.marbles = marbles;
181 const diagrams = typeof marbles === 'string' ? [marbles] : marbles;
182 assertion.expected = diagrams
183 .map((diagram) => toSubscriptionLog(parseSubscriptionMarbles(diagram)))
184 .filter((log) => log.subscribedFrame !== Infinity);
185 },
186 };
187 }
188
189 async evaluate(): Promise<void> {
190 for (const assertion of this.#assertions) {

Callers

nothing calls this directly

Calls 5

#setMatcherMethod · 0.95
toSubscriptionLogFunction · 0.85
parseSubscriptionMarblesFunction · 0.85
mapMethod · 0.65
filterMethod · 0.45

Tested by

no test coverage detected