mirror of
https://github.com/re-rxjs/react-rxjs.git
synced 2025-12-08 18:01:51 +00:00
24 lines
577 B
TypeScript
24 lines
577 B
TypeScript
import { TestScheduler } from "rxjs/testing"
|
|
import { suspended, SUSPENSE } from "../../src"
|
|
|
|
const scheduler = () =>
|
|
new TestScheduler((actual, expected) => {
|
|
expect(actual).toEqual(expected)
|
|
})
|
|
|
|
describe("operators/suspended", () => {
|
|
it("prepends the stream with SUSPENSE", () => {
|
|
scheduler().run(({ expectObservable, cold }) => {
|
|
const source = cold("----a")
|
|
const expected = " s---a"
|
|
|
|
const result$ = source.pipe(suspended())
|
|
|
|
expectObservable(result$).toBe(expected, {
|
|
s: SUSPENSE,
|
|
a: "a",
|
|
})
|
|
})
|
|
})
|
|
})
|