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