Fix `practical-observable-usage` docs example tests with RxJS v7
test(docs-infra): fix `practical-observable-usage` docs example tests with RxJS v7 (#43880)
Fix `practical-observable-usage` docs example tests with RxJS v7testfix practical observable usage docs example
Committed by gkalpak
commit message
test(docs-infra): fix `practical-observable-usage` docs example tests with RxJS v7 (#43880)
Due to how `debounceTime()` works in RxJS v7, Jasmine's mock clock was
not enough to trigger it. This commit fixes it by providing a similar
mock clock that is able to mock all of `Date.now()`, `setInterval()` and
`setTimeout()`.
PR Close #43880Editor assessment
An exemplar of a testing fix. The subject names the example suite and the RxJS version that broke it, and the body teaches the mechanism: debounceTime in RxJS v7 no longer yielded to Jasmine's mock clock, so a substitute clock mocking Date.now, setInterval and setTimeout together was provided. Root cause and remedy with precision, accurate test framing, and clean hygiene. A genuinely instructive example. The mock-clock diagnosis - debounceTime no longer yielding to Jasmine's clock - is a subtle, reusable lesson about timer virtualization.