import { Source, Sink, Scheduler } from '../../src/index' export interface SourceAssertions { run?: (sink: Sink, scheduler: Scheduler) => any dispose?: () => any } export class FakeSource implements Source { constructor (private assertions?: SourceAssertions) {} static create (assertions?: SourceAssertions) { return new FakeSource(assertions) } run (sink: Sink, scheduler: Scheduler) { if (this.assertions && typeof this.assertions.run === 'function') this.assertions.run(sink, scheduler) const _dispose = this.assertions && typeof this.assertions.dispose === 'function' ? this.assertions.dispose : Function.prototype return { dispose () { _dispose() } } } }