aeon-test
v0.3.0
Published
Marble testing utilities for Aeon reactive streams
Maintainers
Readme
aeon-test
Marble testing utilities and helpers for Aeon.
This package provides:
marble— RxJS-style marble syntax for declaratively constructing test eventscollect— synchronously collect all emitted values from an event into an arraytestEvent— helpers for building events that fire at specific virtual timesassert— assertion helpers for comparing event sequences
For the underlying virtual scheduler, see aeon-scheduler (VirtualScheduler).
Installation
pnpm add -D aeon-test aeon-schedulerQuick Start
import { describe, it, expect } from "vitest";
import { map } from "aeon-core";
import { VirtualScheduler } from "aeon-scheduler";
import { collect } from "aeon-test";
describe("map", () => {
it("doubles each value", () => {
const scheduler = new VirtualScheduler();
const result = collect(
map((x: number) => x * 2, fromArray([1, 2, 3])),
scheduler,
);
expect(result).toEqual([2, 4, 6]);
});
});Documentation
License
MIT
