diff --git a/spec/Observable-spec.ts b/spec/Observable-spec.ts index 9093ed8ae2..a3265bd95d 100644 --- a/spec/Observable-spec.ts +++ b/spec/Observable-spec.ts @@ -2,8 +2,13 @@ import {expect} from 'chai'; import * as sinon from 'sinon'; import * as Rx from '../dist/cjs/Rx'; import {TeardownLogic} from '../dist/cjs/Subscription'; +import marbleTestingSignature = require('./helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, rxTestScheduler }; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; -declare const {asDiagram, expectObservable, rxTestScheduler}; const Subscriber = Rx.Subscriber; const Observable = Rx.Observable; diff --git a/spec/Subject-spec.ts b/spec/Subject-spec.ts index d278c0cba0..0a4b57776d 100644 --- a/spec/Subject-spec.ts +++ b/spec/Subject-spec.ts @@ -1,7 +1,10 @@ import {expect} from 'chai'; import * as Rx from '../dist/cjs/Rx'; +import marbleTestingSignature = require('./helpers/marble-testing'); // tslint:disable-line:no-require-imports -declare const {hot, expectObservable}; +declare const { time }; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; const Subject = Rx.Subject; const Observable = Rx.Observable; diff --git a/spec/observables/SubscribeOnObservable-spec.ts b/spec/observables/SubscribeOnObservable-spec.ts index fb313f0703..353912a78b 100644 --- a/spec/observables/SubscribeOnObservable-spec.ts +++ b/spec/observables/SubscribeOnObservable-spec.ts @@ -2,8 +2,11 @@ import {expect} from 'chai'; import * as sinon from 'sinon'; import * as Rx from '../../dist/cjs/Rx'; import {SubscribeOnObservable} from '../../dist/cjs/observable/SubscribeOnObservable'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports -declare const {hot, expectObservable, expectSubscriptions}; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; describe('SubscribeOnObservable', () => { diff --git a/spec/observables/combineLatest-spec.ts b/spec/observables/combineLatest-spec.ts index e674640638..65bfa08228 100644 --- a/spec/observables/combineLatest-spec.ts +++ b/spec/observables/combineLatest-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, expectObservable, expectSubscriptions, type}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { type }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; const queueScheduler = Rx.Scheduler.queue; diff --git a/spec/observables/concat-spec.ts b/spec/observables/concat-spec.ts index 1e38da091a..f06e5d373a 100644 --- a/spec/observables/concat-spec.ts +++ b/spec/observables/concat-spec.ts @@ -1,6 +1,11 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; const queueScheduler = Rx.Scheduler.queue; diff --git a/spec/observables/defer-spec.ts b/spec/observables/defer-spec.ts index 73728fe39c..df6e391e35 100644 --- a/spec/observables/defer-spec.ts +++ b/spec/observables/defer-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/observables/empty-spec.ts b/spec/observables/empty-spec.ts index f78059a32f..2bf0e8f91d 100644 --- a/spec/observables/empty-spec.ts +++ b/spec/observables/empty-spec.ts @@ -1,5 +1,8 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; const Observable = Rx.Observable; diff --git a/spec/observables/fromEvent-spec.ts b/spec/observables/fromEvent-spec.ts index aa87df58d1..635c977808 100644 --- a/spec/observables/fromEvent-spec.ts +++ b/spec/observables/fromEvent-spec.ts @@ -1,8 +1,11 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +declare const { asDiagram }; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: Rx.TestScheduler; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; + const Observable = Rx.Observable; /** @test {fromEvent} */ diff --git a/spec/observables/fromEventPattern-spec.ts b/spec/observables/fromEventPattern-spec.ts index 9d10e59dd5..86f3b4bada 100644 --- a/spec/observables/fromEventPattern-spec.ts +++ b/spec/observables/fromEventPattern-spec.ts @@ -2,9 +2,12 @@ import {expect} from 'chai'; import * as sinon from 'sinon'; import * as Rx from '../../dist/cjs/Rx'; import {noop} from '../../dist/cjs/util/noop'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: Rx.TestScheduler; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; const Observable = Rx.Observable; /** @test {fromEventPattern} */ diff --git a/spec/observables/if-spec.ts b/spec/observables/if-spec.ts index 4c1c3675ab..0b7ee01dd6 100644 --- a/spec/observables/if-spec.ts +++ b/spec/observables/if-spec.ts @@ -1,5 +1,8 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const expectObservable: typeof marbleTestingSignature.expectObservable; const Observable = Rx.Observable; diff --git a/spec/observables/interval-spec.ts b/spec/observables/interval-spec.ts index 80c41e084f..03fb7bf7c7 100644 --- a/spec/observables/interval-spec.ts +++ b/spec/observables/interval-spec.ts @@ -1,8 +1,11 @@ import {expect} from 'chai'; import * as sinon from 'sinon'; import * as Rx from '../../dist/cjs/Rx'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; const asap = Rx.Scheduler.asap; diff --git a/spec/observables/merge-spec.ts b/spec/observables/merge-spec.ts index fec4bcab24..552144abe8 100644 --- a/spec/observables/merge-spec.ts +++ b/spec/observables/merge-spec.ts @@ -1,6 +1,11 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/never-spec.ts b/spec/observables/never-spec.ts index 7e7b9885f7..8835792c13 100644 --- a/spec/observables/never-spec.ts +++ b/spec/observables/never-spec.ts @@ -1,5 +1,8 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; const Observable = Rx.Observable; diff --git a/spec/observables/of-spec.ts b/spec/observables/of-spec.ts index 88223b0769..1e3cd0bbd5 100644 --- a/spec/observables/of-spec.ts +++ b/spec/observables/of-spec.ts @@ -3,8 +3,10 @@ import * as Rx from '../../dist/cjs/Rx'; import {ArrayObservable} from '../../dist/cjs/observable/ArrayObservable'; import {ScalarObservable} from '../../dist/cjs/observable/ScalarObservable'; import {EmptyObservable} from '../../dist/cjs/observable/EmptyObservable'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +declare const { asDiagram }; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/onErrorResumeNext-spec.ts b/spec/observables/onErrorResumeNext-spec.ts index 0e966e7851..ddff470acf 100644 --- a/spec/observables/onErrorResumeNext-spec.ts +++ b/spec/observables/onErrorResumeNext-spec.ts @@ -1,5 +1,10 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/observables/pairs-spec.ts b/spec/observables/pairs-spec.ts index 9c22172bda..d5cf8b0615 100644 --- a/spec/observables/pairs-spec.ts +++ b/spec/observables/pairs-spec.ts @@ -1,7 +1,9 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +declare const { asDiagram }; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/race-spec.ts b/spec/observables/race-spec.ts index 3193281f1a..b154012f23 100644 --- a/spec/observables/race-spec.ts +++ b/spec/observables/race-spec.ts @@ -1,5 +1,10 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/observables/range-spec.ts b/spec/observables/range-spec.ts index 53d8fe4054..62442aa24f 100644 --- a/spec/observables/range-spec.ts +++ b/spec/observables/range-spec.ts @@ -2,7 +2,10 @@ import {expect} from 'chai'; import * as sinon from 'sinon'; import * as Rx from '../../dist/cjs/Rx'; import {RangeObservable} from '../../dist/cjs/observable/RangeObservable'; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/throw-spec.ts b/spec/observables/throw-spec.ts index a5c995969f..c2b456067a 100644 --- a/spec/observables/throw-spec.ts +++ b/spec/observables/throw-spec.ts @@ -1,7 +1,10 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; import {ErrorObservable} from '../../dist/cjs/observable/ErrorObservable'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/timer-spec.ts b/spec/observables/timer-spec.ts index 4e444247e6..d8f9eb333f 100644 --- a/spec/observables/timer-spec.ts +++ b/spec/observables/timer-spec.ts @@ -1,6 +1,9 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, asDiagram, time, expectObservable}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, time }; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/zip-spec.ts b/spec/observables/zip-spec.ts index 10f3f02908..cc800448c6 100644 --- a/spec/observables/zip-spec.ts +++ b/spec/observables/zip-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, expectObservable, expectSubscriptions, type}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { type }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const Symbol: any; diff --git a/spec/operators/audit-spec.ts b/spec/operators/audit-spec.ts index ee2970b9e6..6f0a455fb2 100644 --- a/spec/operators/audit-spec.ts +++ b/spec/operators/audit-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/auditTime-spec.ts b/spec/operators/auditTime-spec.ts index 00a8cb83e2..8c1491a989 100644 --- a/spec/operators/auditTime-spec.ts +++ b/spec/operators/auditTime-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/buffer-spec.ts b/spec/operators/buffer-spec.ts index 6912aaf7b2..dc17061c5a 100644 --- a/spec/operators/buffer-spec.ts +++ b/spec/operators/buffer-spec.ts @@ -1,5 +1,10 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/bufferCount-spec.ts b/spec/operators/bufferCount-spec.ts index bdf87ce9df..c52b6cf471 100644 --- a/spec/operators/bufferCount-spec.ts +++ b/spec/operators/bufferCount-spec.ts @@ -1,141 +1,146 @@ -import * as Rx from '../../dist/cjs/Rx'; -import { expect } from 'chai'; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; - -const Observable = Rx.Observable; - -/** @test {bufferCount} */ -describe('Observable.prototype.bufferCount', () => { - asDiagram('bufferCount(3,2)')('should emit buffers at intervals', () => { - const values = { - v: ['a', 'b', 'c'], - w: ['c', 'd', 'e'], - x: ['e', 'f', 'g'], - y: ['g', 'h', 'i'], - z: ['i'] - }; - const e1 = hot('--a--b--c--d--e--f--g--h--i--|'); - const expected = '--------v-----w-----x-----y--(z|)'; - - expectObservable(e1.bufferCount(3, 2)).toBe(expected, values); - }); - - it('should emit buffers at buffersize of intervals if not specified', () => { - const values = { - x: ['a', 'b'], - y: ['c', 'd'], - z: ['e', 'f'] - }; - const e1 = hot('--a--b--c--d--e--f--|'); - const expected = '-----x-----y-----z--|'; - - expectObservable(e1.bufferCount(2)).toBe(expected, values); - }); - - it('should buffer properly (issue #2062)', () => { - const item$ = new Rx.Subject(); - const results = []; - item$ - .bufferCount(3, 1) - .subscribe(value => { - results.push(value); - - if (value.join() === '1,2,3') { - item$.next(4); - } - }); - - item$.next(1); - item$.next(2); - item$.next(3); - - expect(results).to.deep.equal([[1, 2, 3], [2, 3, 4]]); - }); - - it('should emit partial buffers if source completes before reaching specified buffer count', () => { - const e1 = hot('--a--b--c--d--|'); - const expected = '--------------(x|)'; - - expectObservable(e1.bufferCount(5)).toBe(expected, {x: ['a', 'b', 'c', 'd']}); - }); - - it('should emit full buffer then last partial buffer if source completes', () => { - const e1 = hot('--a^-b--c--d--e--|'); - const e1subs = '^ !'; - const expected = '--------y-----(z|)'; - - expectObservable(e1.bufferCount(3)).toBe(expected, {y: ['b', 'c', 'd'], z: ['e']}); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should emit buffers at intervals, but stop when result is unsubscribed early', () => { - const values = { - v: ['a', 'b', 'c'], - w: ['c', 'd', 'e'] - }; - const e1 = hot('--a--b--c--d--e--f--g--h--i--|'); - const unsub = ' ! '; - const subs = '^ ! '; - const expected = '--------v-----w---- '; - - expectObservable(e1.bufferCount(3, 2), unsub).toBe(expected, values); - expectSubscriptions(e1.subscriptions).toBe(subs); - }); - - it('should not break unsubscription chains when result is unsubscribed explicitly', () => { - const values = { - v: ['a', 'b', 'c'], - w: ['c', 'd', 'e'] - }; - const e1 = hot('--a--b--c--d--e--f--g--h--i--|'); - const subs = '^ ! '; - const expected = '--------v-----w---- '; - const unsub = ' ! '; - - const result = e1 - .mergeMap((x: any) => Observable.of(x)) - .bufferCount(3, 2) - .mergeMap((x: any) => Observable.of(x)); - - expectObservable(result, unsub).toBe(expected, values); - expectSubscriptions(e1.subscriptions).toBe(subs); - }); - - it('should raise error if source raise error before reaching specified buffer count', () => { - const e1 = hot('--a--b--c--d--#'); - const e1subs = '^ !'; - const expected = '--------------#'; - - expectObservable(e1.bufferCount(5)).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should emit buffers with specified skip count when skip count is less than window count', () => { - const values = { - v: ['a', 'b', 'c'], - w: ['b', 'c', 'd'], - x: ['c', 'd', 'e'], - y: ['d', 'e'], - z: ['e'] - }; - const e1 = hot('--a--b--c--d--e--|'); - const e1subs = '^ !'; - const expected = '--------v--w--x--(yz|)'; - - expectObservable(e1.bufferCount(3, 1)).toBe(expected, values); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should emit buffers with specified skip count when skip count is more than window count', () => { - const e1 = hot('--a--b--c--d--e--|'); - const e1subs = '^ !'; - const expected = '-----y--------z--|'; - const values = { - y: ['a', 'b'], - z: ['d', 'e'] - }; - - expectObservable(e1.bufferCount(2, 3)).toBe(expected, values); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); +import * as Rx from '../../dist/cjs/Rx'; +import { expect } from 'chai'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; + +const Observable = Rx.Observable; + +/** @test {bufferCount} */ +describe('Observable.prototype.bufferCount', () => { + asDiagram('bufferCount(3,2)')('should emit buffers at intervals', () => { + const values = { + v: ['a', 'b', 'c'], + w: ['c', 'd', 'e'], + x: ['e', 'f', 'g'], + y: ['g', 'h', 'i'], + z: ['i'] + }; + const e1 = hot('--a--b--c--d--e--f--g--h--i--|'); + const expected = '--------v-----w-----x-----y--(z|)'; + + expectObservable(e1.bufferCount(3, 2)).toBe(expected, values); + }); + + it('should emit buffers at buffersize of intervals if not specified', () => { + const values = { + x: ['a', 'b'], + y: ['c', 'd'], + z: ['e', 'f'] + }; + const e1 = hot('--a--b--c--d--e--f--|'); + const expected = '-----x-----y-----z--|'; + + expectObservable(e1.bufferCount(2)).toBe(expected, values); + }); + + it('should buffer properly (issue #2062)', () => { + const item$ = new Rx.Subject(); + const results = []; + item$ + .bufferCount(3, 1) + .subscribe(value => { + results.push(value); + + if (value.join() === '1,2,3') { + item$.next(4); + } + }); + + item$.next(1); + item$.next(2); + item$.next(3); + + expect(results).to.deep.equal([[1, 2, 3], [2, 3, 4]]); + }); + + it('should emit partial buffers if source completes before reaching specified buffer count', () => { + const e1 = hot('--a--b--c--d--|'); + const expected = '--------------(x|)'; + + expectObservable(e1.bufferCount(5)).toBe(expected, {x: ['a', 'b', 'c', 'd']}); + }); + + it('should emit full buffer then last partial buffer if source completes', () => { + const e1 = hot('--a^-b--c--d--e--|'); + const e1subs = '^ !'; + const expected = '--------y-----(z|)'; + + expectObservable(e1.bufferCount(3)).toBe(expected, {y: ['b', 'c', 'd'], z: ['e']}); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should emit buffers at intervals, but stop when result is unsubscribed early', () => { + const values = { + v: ['a', 'b', 'c'], + w: ['c', 'd', 'e'] + }; + const e1 = hot('--a--b--c--d--e--f--g--h--i--|'); + const unsub = ' ! '; + const subs = '^ ! '; + const expected = '--------v-----w---- '; + + expectObservable(e1.bufferCount(3, 2), unsub).toBe(expected, values); + expectSubscriptions(e1.subscriptions).toBe(subs); + }); + + it('should not break unsubscription chains when result is unsubscribed explicitly', () => { + const values = { + v: ['a', 'b', 'c'], + w: ['c', 'd', 'e'] + }; + const e1 = hot('--a--b--c--d--e--f--g--h--i--|'); + const subs = '^ ! '; + const expected = '--------v-----w---- '; + const unsub = ' ! '; + + const result = e1 + .mergeMap((x: any) => Observable.of(x)) + .bufferCount(3, 2) + .mergeMap((x: any) => Observable.of(x)); + + expectObservable(result, unsub).toBe(expected, values); + expectSubscriptions(e1.subscriptions).toBe(subs); + }); + + it('should raise error if source raise error before reaching specified buffer count', () => { + const e1 = hot('--a--b--c--d--#'); + const e1subs = '^ !'; + const expected = '--------------#'; + + expectObservable(e1.bufferCount(5)).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should emit buffers with specified skip count when skip count is less than window count', () => { + const values = { + v: ['a', 'b', 'c'], + w: ['b', 'c', 'd'], + x: ['c', 'd', 'e'], + y: ['d', 'e'], + z: ['e'] + }; + const e1 = hot('--a--b--c--d--e--|'); + const e1subs = '^ !'; + const expected = '--------v--w--x--(yz|)'; + + expectObservable(e1.bufferCount(3, 1)).toBe(expected, values); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should emit buffers with specified skip count when skip count is more than window count', () => { + const e1 = hot('--a--b--c--d--e--|'); + const e1subs = '^ !'; + const expected = '-----y--------z--|'; + const values = { + y: ['a', 'b'], + z: ['d', 'e'] + }; + + expectObservable(e1.bufferCount(2, 3)).toBe(expected, values); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); }); \ No newline at end of file diff --git a/spec/operators/bufferTime-spec.ts b/spec/operators/bufferTime-spec.ts index defed5bd0c..29b0b5642b 100644 --- a/spec/operators/bufferTime-spec.ts +++ b/spec/operators/bufferTime-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, time, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, time }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/bufferToggle-spec.ts b/spec/operators/bufferToggle-spec.ts index 0d78a28242..18f49ebc78 100644 --- a/spec/operators/bufferToggle-spec.ts +++ b/spec/operators/bufferToggle-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/bufferWhen-spec.ts b/spec/operators/bufferWhen-spec.ts index f55b72dee3..566f530c33 100644 --- a/spec/operators/bufferWhen-spec.ts +++ b/spec/operators/bufferWhen-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/catch-spec.ts b/spec/operators/catch-spec.ts index ebd13a490d..5e2b076405 100644 --- a/spec/operators/catch-spec.ts +++ b/spec/operators/catch-spec.ts @@ -1,7 +1,13 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; import {createObservableInputs} from '../helpers/test-helper'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestSchdeuler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/combineAll-spec.ts b/spec/operators/combineAll-spec.ts index adad373139..cd6dd3edcd 100644 --- a/spec/operators/combineAll-spec.ts +++ b/spec/operators/combineAll-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; const queueScheduler = Rx.Scheduler.queue; diff --git a/spec/operators/combineLatest-spec.ts b/spec/operators/combineLatest-spec.ts index 0aaefe1125..5d551e5fd4 100644 --- a/spec/operators/combineLatest-spec.ts +++ b/spec/operators/combineLatest-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, asDiagram, cold, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/concat-spec.ts b/spec/operators/concat-spec.ts index 2a4bb92701..f669c1ddae 100644 --- a/spec/operators/concat-spec.ts +++ b/spec/operators/concat-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/concatAll-spec.ts b/spec/operators/concatAll-spec.ts index 4d38220eba..b217460e43 100644 --- a/spec/operators/concatAll-spec.ts +++ b/spec/operators/concatAll-spec.ts @@ -1,7 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/concatMap-spec.ts b/spec/operators/concatMap-spec.ts index 5905a90c85..3f989487df 100644 --- a/spec/operators/concatMap-spec.ts +++ b/spec/operators/concatMap-spec.ts @@ -1,7 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; /** @test {concatMap} */ diff --git a/spec/operators/concatMapTo-spec.ts b/spec/operators/concatMapTo-spec.ts index f6f3bf82bc..05c9f55b02 100644 --- a/spec/operators/concatMapTo-spec.ts +++ b/spec/operators/concatMapTo-spec.ts @@ -1,7 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; /** @test {concatMapTo} */ diff --git a/spec/operators/count-spec.ts b/spec/operators/count-spec.ts index d552af1db0..08d12310a7 100644 --- a/spec/operators/count-spec.ts +++ b/spec/operators/count-spec.ts @@ -1,7 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; /** @test {count} */ diff --git a/spec/operators/debounce-spec.ts b/spec/operators/debounce-spec.ts index 6c7c3e1951..b2ff1f6da7 100644 --- a/spec/operators/debounce-spec.ts +++ b/spec/operators/debounce-spec.ts @@ -1,7 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/debounceTime-spec.ts b/spec/operators/debounceTime-spec.ts index f18a534354..324c24832e 100644 --- a/spec/operators/debounceTime-spec.ts +++ b/spec/operators/debounceTime-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/defaultIfEmpty-spec.ts b/spec/operators/defaultIfEmpty-spec.ts index 3a3bda191e..9677157f7c 100644 --- a/spec/operators/defaultIfEmpty-spec.ts +++ b/spec/operators/defaultIfEmpty-spec.ts @@ -1,6 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; /** @test {defaultIfEmpty} */ diff --git a/spec/operators/delay-spec.ts b/spec/operators/delay-spec.ts index d67f884564..60331bbf50 100644 --- a/spec/operators/delay-spec.ts +++ b/spec/operators/delay-spec.ts @@ -1,6 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, asDiagram, cold, time, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +declare const { asDiagram, time }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/delayWhen-spec.ts b/spec/operators/delayWhen-spec.ts index 6ff759e7a8..850b98af84 100644 --- a/spec/operators/delayWhen-spec.ts +++ b/spec/operators/delayWhen-spec.ts @@ -1,6 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; /** @test {delayWhen} */ diff --git a/spec/operators/dematerialize-spec.ts b/spec/operators/dematerialize-spec.ts index c0869f4617..5123138c73 100644 --- a/spec/operators/dematerialize-spec.ts +++ b/spec/operators/dematerialize-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; const Notification = Rx.Notification; diff --git a/spec/operators/distinct-spec.ts b/spec/operators/distinct-spec.ts index cda0bbe65e..dccbaf52b4 100644 --- a/spec/operators/distinct-spec.ts +++ b/spec/operators/distinct-spec.ts @@ -1,215 +1,219 @@ -import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, expectObservable, expectSubscriptions}; - -const Observable = Rx.Observable; - -/** @test {distinct} */ -describe('Observable.prototype.distinct', () => { - it('should distinguish between values', () => { - const e1 = hot('--a--a--a--b--b--a--|'); - const e1subs = '^ !'; - const expected = '--a--------b--------|'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should distinguish between values and does not completes', () => { - const e1 = hot('--a--a--a--b--b--a-'); - const e1subs = '^ '; - const expected = '--a--------b-------'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should not completes if source never completes', () => { - const e1 = cold('-'); - const e1subs = '^'; - const expected = '-'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should not completes if source does not completes', () => { - const e1 = hot('-'); - const e1subs = '^'; - const expected = '-'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should complete if source is empty', () => { - const e1 = cold('|'); - const e1subs = '(^!)'; - const expected = '|'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should complete if source does not emit', () => { - const e1 = hot('------|'); - const e1subs = '^ !'; - const expected = '------|'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should emit if source emits single element only', () => { - const e1 = hot('--a--|'); - const e1subs = '^ !'; - const expected = '--a--|'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should emit if source is scalar', () => { - const e1 = Observable.of('a'); - const expected = '(a|)'; - - expectObservable((e1).distinct()).toBe(expected); - }); - - it('should raises error if source raises error', () => { - const e1 = hot('--a--a--#'); - const e1subs = '^ !'; - const expected = '--a-----#'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should raises error if source throws', () => { - const e1 = cold('#'); - const e1subs = '(^!)'; - const expected = '#'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should not omit if source elements are all different', () => { - const e1 = hot('--a--b--c--d--e--f--|'); - const e1subs = '^ !'; - const expected = '--a--b--c--d--e--f--|'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should allow unsubscribing early and explicitly', () => { - const e1 = hot('--a--b--b--d--a--f--|'); - const e1subs = '^ ! '; - const expected = '--a--b----- '; - const unsub = ' ! '; - - const result = (e1).distinct(); - - expectObservable(result, unsub).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should not break unsubscription chains when unsubscribed explicitly', () => { - const e1 = hot('--a--b--b--d--a--f--|'); - const e1subs = '^ ! '; - const expected = '--a--b----- '; - const unsub = ' ! '; - - const result = (e1 - .mergeMap((x: any) => Observable.of(x))) - .distinct() - .mergeMap((x: any) => Observable.of(x)); - - expectObservable(result, unsub).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should emit once if source elements are all same', () => { - const e1 = hot('--a--a--a--a--a--a--|'); - const e1subs = '^ !'; - const expected = '--a-----------------|'; - - expectObservable((e1).distinct()).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should distinguish values by key', () => { - const values = {a: 1, b: 2, c: 3, d: 4, e: 5, f: 6}; - const e1 = hot('--a--b--c--d--e--f--|', values); - const e1subs = '^ !'; - const expected = '--a--b--c-----------|'; - const selector = (value: number) => value % 3; - - expectObservable((e1).distinct(selector)).toBe(expected, values); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should raises error when selector throws', () => { - const e1 = hot('--a--b--c--d--e--f--|'); - const e1subs = '^ ! '; - const expected = '--a--b--c--# '; - const selector = (value: string) => { - if (value === 'd') { - throw new Error('d is for dumb'); - } - return value; - }; - - expectObservable((e1).distinct(selector)).toBe(expected, undefined, new Error('d is for dumb')); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should support a flushing stream', () => { - const e1 = hot('--a--b--a--b--a--b--|'); - const e1subs = '^ !'; - const e2 = hot('-----------x--------|'); - const e2subs = '^ !'; - const expected = '--a--b--------a--b--|'; - - expectObservable((e1).distinct(null, e2)).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - expectSubscriptions(e2.subscriptions).toBe(e2subs); - }); - - it('should raise error if flush raises error', () => { - const e1 = hot('--a--b--a--b--a--b--|'); - const e1subs = '^ !'; - const e2 = hot('-----------x-#'); - const e2subs = '^ !'; - const expected = '--a--b-------#'; - - expectObservable((e1).distinct(null, e2)).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - expectSubscriptions(e2.subscriptions).toBe(e2subs); - }); - - it('should unsubscribe from the flushing stream when the main stream is unsubbed', () => { - const e1 = hot('--a--b--a--b--a--b--|'); - const e1subs = '^ ! '; - const e2 = hot('-----------x--------|'); - const e2subs = '^ ! '; - const unsub = ' ! '; - const expected = '--a--b------'; - - expectObservable((e1).distinct(null, e2), unsub).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - expectSubscriptions(e2.subscriptions).toBe(e2subs); - }); - - it('should allow opting in to default comparator with flush', () => { - const e1 = hot('--a--b--a--b--a--b--|'); - const e1subs = '^ !'; - const e2 = hot('-----------x--------|'); - const e2subs = '^ !'; - const expected = '--a--b--------a--b--|'; - - expectObservable((e1).distinct(null, e2)).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - expectSubscriptions(e2.subscriptions).toBe(e2subs); - }); +import * as Rx from '../../dist/cjs/Rx'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +const Observable = Rx.Observable; + +/** @test {distinct} */ +describe('Observable.prototype.distinct', () => { + it('should distinguish between values', () => { + const e1 = hot('--a--a--a--b--b--a--|'); + const e1subs = '^ !'; + const expected = '--a--------b--------|'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should distinguish between values and does not completes', () => { + const e1 = hot('--a--a--a--b--b--a-'); + const e1subs = '^ '; + const expected = '--a--------b-------'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should not completes if source never completes', () => { + const e1 = cold('-'); + const e1subs = '^'; + const expected = '-'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should not completes if source does not completes', () => { + const e1 = hot('-'); + const e1subs = '^'; + const expected = '-'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should complete if source is empty', () => { + const e1 = cold('|'); + const e1subs = '(^!)'; + const expected = '|'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should complete if source does not emit', () => { + const e1 = hot('------|'); + const e1subs = '^ !'; + const expected = '------|'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should emit if source emits single element only', () => { + const e1 = hot('--a--|'); + const e1subs = '^ !'; + const expected = '--a--|'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should emit if source is scalar', () => { + const e1 = Observable.of('a'); + const expected = '(a|)'; + + expectObservable((e1).distinct()).toBe(expected); + }); + + it('should raises error if source raises error', () => { + const e1 = hot('--a--a--#'); + const e1subs = '^ !'; + const expected = '--a-----#'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should raises error if source throws', () => { + const e1 = cold('#'); + const e1subs = '(^!)'; + const expected = '#'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should not omit if source elements are all different', () => { + const e1 = hot('--a--b--c--d--e--f--|'); + const e1subs = '^ !'; + const expected = '--a--b--c--d--e--f--|'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should allow unsubscribing early and explicitly', () => { + const e1 = hot('--a--b--b--d--a--f--|'); + const e1subs = '^ ! '; + const expected = '--a--b----- '; + const unsub = ' ! '; + + const result = (e1).distinct(); + + expectObservable(result, unsub).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should not break unsubscription chains when unsubscribed explicitly', () => { + const e1 = hot('--a--b--b--d--a--f--|'); + const e1subs = '^ ! '; + const expected = '--a--b----- '; + const unsub = ' ! '; + + const result = (e1 + .mergeMap((x: any) => Observable.of(x))) + .distinct() + .mergeMap((x: any) => Observable.of(x)); + + expectObservable(result, unsub).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should emit once if source elements are all same', () => { + const e1 = hot('--a--a--a--a--a--a--|'); + const e1subs = '^ !'; + const expected = '--a-----------------|'; + + expectObservable((e1).distinct()).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should distinguish values by key', () => { + const values = {a: 1, b: 2, c: 3, d: 4, e: 5, f: 6}; + const e1 = hot('--a--b--c--d--e--f--|', values); + const e1subs = '^ !'; + const expected = '--a--b--c-----------|'; + const selector = (value: number) => value % 3; + + expectObservable((e1).distinct(selector)).toBe(expected, values); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should raises error when selector throws', () => { + const e1 = hot('--a--b--c--d--e--f--|'); + const e1subs = '^ ! '; + const expected = '--a--b--c--# '; + const selector = (value: string) => { + if (value === 'd') { + throw new Error('d is for dumb'); + } + return value; + }; + + expectObservable((e1).distinct(selector)).toBe(expected, undefined, new Error('d is for dumb')); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should support a flushing stream', () => { + const e1 = hot('--a--b--a--b--a--b--|'); + const e1subs = '^ !'; + const e2 = hot('-----------x--------|'); + const e2subs = '^ !'; + const expected = '--a--b--------a--b--|'; + + expectObservable((e1).distinct(null, e2)).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + expectSubscriptions(e2.subscriptions).toBe(e2subs); + }); + + it('should raise error if flush raises error', () => { + const e1 = hot('--a--b--a--b--a--b--|'); + const e1subs = '^ !'; + const e2 = hot('-----------x-#'); + const e2subs = '^ !'; + const expected = '--a--b-------#'; + + expectObservable((e1).distinct(null, e2)).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + expectSubscriptions(e2.subscriptions).toBe(e2subs); + }); + + it('should unsubscribe from the flushing stream when the main stream is unsubbed', () => { + const e1 = hot('--a--b--a--b--a--b--|'); + const e1subs = '^ ! '; + const e2 = hot('-----------x--------|'); + const e2subs = '^ ! '; + const unsub = ' ! '; + const expected = '--a--b------'; + + expectObservable((e1).distinct(null, e2), unsub).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + expectSubscriptions(e2.subscriptions).toBe(e2subs); + }); + + it('should allow opting in to default comparator with flush', () => { + const e1 = hot('--a--b--a--b--a--b--|'); + const e1subs = '^ !'; + const e2 = hot('-----------x--------|'); + const e2subs = '^ !'; + const expected = '--a--b--------a--b--|'; + + expectObservable((e1).distinct(null, e2)).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + expectSubscriptions(e2.subscriptions).toBe(e2subs); + }); }); \ No newline at end of file diff --git a/spec/operators/distinctUntilChanged-spec.ts b/spec/operators/distinctUntilChanged-spec.ts index 4114d5818c..8c96e6e73e 100644 --- a/spec/operators/distinctUntilChanged-spec.ts +++ b/spec/operators/distinctUntilChanged-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/distinctUntilKeyChanged-spec.ts b/spec/operators/distinctUntilKeyChanged-spec.ts index e2308472f6..aa40e1d3b9 100644 --- a/spec/operators/distinctUntilKeyChanged-spec.ts +++ b/spec/operators/distinctUntilKeyChanged-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; /** @test {distinctUntilKeyChanged} */ describe('Observable.prototype.distinctUntilKeyChanged', () => { diff --git a/spec/operators/do-spec.ts b/spec/operators/do-spec.ts index fbfb844974..f2bc1a640a 100644 --- a/spec/operators/do-spec.ts +++ b/spec/operators/do-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; const Subject = Rx.Subject; diff --git a/spec/operators/elementAt-spec.ts b/spec/operators/elementAt-spec.ts index 62f026e222..ac27b5cc85 100644 --- a/spec/operators/elementAt-spec.ts +++ b/spec/operators/elementAt-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/every-spec.ts b/spec/operators/every-spec.ts index 9f7ab07469..403fd559d8 100644 --- a/spec/operators/every-spec.ts +++ b/spec/operators/every-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/exhaust-spec.ts b/spec/operators/exhaust-spec.ts index a2f8f7216f..fe6a3793ed 100644 --- a/spec/operators/exhaust-spec.ts +++ b/spec/operators/exhaust-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/exhaustMap-spec.ts b/spec/operators/exhaustMap-spec.ts index 1d5f1ad180..c99c2a977b 100644 --- a/spec/operators/exhaustMap-spec.ts +++ b/spec/operators/exhaustMap-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/expand-spec.ts b/spec/operators/expand-spec.ts index 725d38d3db..bbb9ea25d1 100644 --- a/spec/operators/expand-spec.ts +++ b/spec/operators/expand-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const Symbol: any; declare const rxTestScheduler: Rx.TestScheduler; diff --git a/spec/operators/finally-spec.ts b/spec/operators/finally-spec.ts index 60e1ebc8f8..74a8e9bd54 100644 --- a/spec/operators/finally-spec.ts +++ b/spec/operators/finally-spec.ts @@ -1,9 +1,15 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, Symbol, type }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; -declare const {asDiagram, expectObservable, Symbol, type}; declare const rxTestScheduler: Rx.TestScheduler; /** @test {finally} */ diff --git a/spec/operators/find-spec.ts b/spec/operators/find-spec.ts index e15956f391..b9094cef02 100644 --- a/spec/operators/find-spec.ts +++ b/spec/operators/find-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/findIndex-spec.ts b/spec/operators/findIndex-spec.ts index 8c6b58df1d..b3a8934426 100644 --- a/spec/operators/findIndex-spec.ts +++ b/spec/operators/findIndex-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/first-spec.ts b/spec/operators/first-spec.ts index eebc2da02a..91f031dfbb 100644 --- a/spec/operators/first-spec.ts +++ b/spec/operators/first-spec.ts @@ -1,6 +1,11 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/groupBy-spec.ts b/spec/operators/groupBy-spec.ts index e7cb3dc9ce..5a6d35d75f 100644 --- a/spec/operators/groupBy-spec.ts +++ b/spec/operators/groupBy-spec.ts @@ -1,7 +1,13 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; import {GroupedObservable} from '../../dist/cjs/operator/groupBy'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/ignoreElements-spec.ts b/spec/operators/ignoreElements-spec.ts index 982cab7d94..d96fe121cb 100644 --- a/spec/operators/ignoreElements-spec.ts +++ b/spec/operators/ignoreElements-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/isEmpty-spec.ts b/spec/operators/isEmpty-spec.ts index 5b88211372..d393afb825 100644 --- a/spec/operators/isEmpty-spec.ts +++ b/spec/operators/isEmpty-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; /** @test {isEmpty} */ describe('Observable.prototype.isEmpty', () => { diff --git a/spec/operators/last-spec.ts b/spec/operators/last-spec.ts index 759c6d5ecf..61726aecc8 100644 --- a/spec/operators/last-spec.ts +++ b/spec/operators/last-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/map-spec.ts b/spec/operators/map-spec.ts index 6aa33e64f3..ac24af38d5 100644 --- a/spec/operators/map-spec.ts +++ b/spec/operators/map-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/mapTo-spec.ts b/spec/operators/mapTo-spec.ts index ed2549e37a..185dd01a23 100644 --- a/spec/operators/mapTo-spec.ts +++ b/spec/operators/mapTo-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/materialize-spec.ts b/spec/operators/materialize-spec.ts index dc0ea708e8..faa8440d15 100644 --- a/spec/operators/materialize-spec.ts +++ b/spec/operators/materialize-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; const Notification = Rx.Notification; diff --git a/spec/operators/max-spec.ts b/spec/operators/max-spec.ts index b41cdc0c7f..c6b47aace4 100644 --- a/spec/operators/max-spec.ts +++ b/spec/operators/max-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/merge-spec.ts b/spec/operators/merge-spec.ts index 36fe732eaf..84c3757ff9 100644 --- a/spec/operators/merge-spec.ts +++ b/spec/operators/merge-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/mergeAll-spec.ts b/spec/operators/mergeAll-spec.ts index 837d2f1d84..0aa533d8ce 100644 --- a/spec/operators/mergeAll-spec.ts +++ b/spec/operators/mergeAll-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/mergeMap-spec.ts b/spec/operators/mergeMap-spec.ts index d279505780..5df1f1af8f 100644 --- a/spec/operators/mergeMap-spec.ts +++ b/spec/operators/mergeMap-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions, type}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, type }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/mergeMapTo-spec.ts b/spec/operators/mergeMapTo-spec.ts index f1b05dd5a3..d12296d796 100644 --- a/spec/operators/mergeMapTo-spec.ts +++ b/spec/operators/mergeMapTo-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions, type}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, type }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/mergeScan-spec.ts b/spec/operators/mergeScan-spec.ts index c5a7d1c4a8..5edceebe3b 100644 --- a/spec/operators/mergeScan-spec.ts +++ b/spec/operators/mergeScan-spec.ts @@ -1,5 +1,10 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/min-spec.ts b/spec/operators/min-spec.ts index c3c2b48a9c..0c8d248275 100644 --- a/spec/operators/min-spec.ts +++ b/spec/operators/min-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/multicast-spec.ts b/spec/operators/multicast-spec.ts index acc199a031..1793d9c499 100644 --- a/spec/operators/multicast-spec.ts +++ b/spec/operators/multicast-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions, time, rxTestScheduler}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, time, rxTestScheduler }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; const Subject = Rx.Subject; @@ -56,7 +62,7 @@ describe('Observable.prototype.multicast', () => { ' ^ !', ' ^ !']; const multicasted = source.multicast(() => new Subject(), - x => x.zip(x, (a, b) => (parseInt(a) + parseInt(b)).toString())); + x => x.zip(x, (a: string, b: string) => (parseInt(a) + parseInt(b)).toString())); const subscriber1 = hot('a| ').mergeMapTo(multicasted); const expected1 = '-2-4-6----8-|'; const subscriber2 = hot(' b| ').mergeMapTo(multicasted); @@ -76,7 +82,7 @@ describe('Observable.prototype.multicast', () => { ' ^ !', ' ^ !']; const multicasted = source.multicast(() => new Subject(), - x => x.zip(x, (a, b) => (parseInt(a) + parseInt(b)).toString())); + x => x.zip(x, (a: string, b: string) => (parseInt(a) + parseInt(b)).toString())); const expected1 = '-2-4-6----8-|'; const expected2 = ' -2-4-6----8-|'; const expected3 = ' -2-4-6----8-|'; diff --git a/spec/operators/observeOn-spec.ts b/spec/operators/observeOn-spec.ts index 8e4a10b2d9..039f04c486 100644 --- a/spec/operators/observeOn-spec.ts +++ b/spec/operators/observeOn-spec.ts @@ -1,7 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; import { expect } from 'chai'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/onErrorResumeNext-spec.ts b/spec/operators/onErrorResumeNext-spec.ts index 420d1de7fd..8359917b88 100644 --- a/spec/operators/onErrorResumeNext-spec.ts +++ b/spec/operators/onErrorResumeNext-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/pairwise-spec.ts b/spec/operators/pairwise-spec.ts index 37f2638846..06c20c053a 100644 --- a/spec/operators/pairwise-spec.ts +++ b/spec/operators/pairwise-spec.ts @@ -1,4 +1,10 @@ -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; /** @test {pairwise} */ describe('Observable.prototype.pairwise', () => { diff --git a/spec/operators/partition-spec.ts b/spec/operators/partition-spec.ts index 140e7a503a..2c9736d7be 100644 --- a/spec/operators/partition-spec.ts +++ b/spec/operators/partition-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/pluck-spec.ts b/spec/operators/pluck-spec.ts index 66da8adcf7..584cd227dd 100644 --- a/spec/operators/pluck-spec.ts +++ b/spec/operators/pluck-spec.ts @@ -1,6 +1,11 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/publish-spec.ts b/spec/operators/publish-spec.ts index 47891178af..4b85f7740d 100644 --- a/spec/operators/publish-spec.ts +++ b/spec/operators/publish-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/publishBehavior-spec.ts b/spec/operators/publishBehavior-spec.ts index 9cdbd7c280..e1d52a16b6 100644 --- a/spec/operators/publishBehavior-spec.ts +++ b/spec/operators/publishBehavior-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/publishLast-spec.ts b/spec/operators/publishLast-spec.ts index ce981fdc92..032b2d8950 100644 --- a/spec/operators/publishLast-spec.ts +++ b/spec/operators/publishLast-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/publishReplay-spec.ts b/spec/operators/publishReplay-spec.ts index 825d2cc661..592a15c64e 100644 --- a/spec/operators/publishReplay-spec.ts +++ b/spec/operators/publishReplay-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/race-spec.ts b/spec/operators/race-spec.ts index ac507cc60a..89ac62aa48 100644 --- a/spec/operators/race-spec.ts +++ b/spec/operators/race-spec.ts @@ -1,7 +1,12 @@ import {expect} from 'chai'; import * as sinon from 'sinon'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/reduce-spec.ts b/spec/operators/reduce-spec.ts index 690ebd5786..1c228343d5 100644 --- a/spec/operators/reduce-spec.ts +++ b/spec/operators/reduce-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions, type}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, type }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/refCount-spec.ts b/spec/operators/refCount-spec.ts index ffb65ac860..ff30f13ed1 100644 --- a/spec/operators/refCount-spec.ts +++ b/spec/operators/refCount-spec.ts @@ -1,6 +1,11 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {cold, expectObservable, asDiagram, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/repeat-spec.ts b/spec/operators/repeat-spec.ts index da55583e60..fc0e417184 100644 --- a/spec/operators/repeat-spec.ts +++ b/spec/operators/repeat-spec.ts @@ -1,6 +1,11 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/repeatWhen-spec.ts b/spec/operators/repeatWhen-spec.ts index 0df4a6672b..ad8e6f47c9 100644 --- a/spec/operators/repeatWhen-spec.ts +++ b/spec/operators/repeatWhen-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/retry-spec.ts b/spec/operators/retry-spec.ts index 8cbd20943c..3aea5c51c9 100644 --- a/spec/operators/retry-spec.ts +++ b/spec/operators/retry-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/retryWhen-spec.ts b/spec/operators/retryWhen-spec.ts index e9ac2ebcd6..eaac675b29 100644 --- a/spec/operators/retryWhen-spec.ts +++ b/spec/operators/retryWhen-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/sample-spec.ts b/spec/operators/sample-spec.ts index 275c4eb034..013889f538 100644 --- a/spec/operators/sample-spec.ts +++ b/spec/operators/sample-spec.ts @@ -1,7 +1,12 @@ import * as Rx from '../../dist/cjs/Rx'; import { expect } from 'chai'; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/sampleTime-spec.ts b/spec/operators/sampleTime-spec.ts index 6c5689f758..85ff41209c 100644 --- a/spec/operators/sampleTime-spec.ts +++ b/spec/operators/sampleTime-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/scan-spec.ts b/spec/operators/scan-spec.ts index ed2fc37945..c0122615d9 100644 --- a/spec/operators/scan-spec.ts +++ b/spec/operators/scan-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions, type}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, type }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/sequenceEqual-spec.ts b/spec/operators/sequenceEqual-spec.ts index 9ed4790122..5e386bcc15 100644 --- a/spec/operators/sequenceEqual-spec.ts +++ b/spec/operators/sequenceEqual-spec.ts @@ -1,5 +1,11 @@ -declare const {rxTestScheduler, time, type}; import * as _ from 'lodash'; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, rxTestScheduler, time, type }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const booleans = { T: true, F: false }; diff --git a/spec/operators/share-spec.ts b/spec/operators/share-spec.ts index 4e3c979d91..0d682fb65a 100644 --- a/spec/operators/share-spec.ts +++ b/spec/operators/share-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/single-spec.ts b/spec/operators/single-spec.ts index f3cc5a3e0f..08befa2064 100644 --- a/spec/operators/single-spec.ts +++ b/spec/operators/single-spec.ts @@ -1,5 +1,10 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; /** @test {single} */ diff --git a/spec/operators/skip-spec.ts b/spec/operators/skip-spec.ts index 3bfdedd9fe..ec9e5710aa 100644 --- a/spec/operators/skip-spec.ts +++ b/spec/operators/skip-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/skipUntil-spec.ts b/spec/operators/skipUntil-spec.ts index 46fa9c3b10..6111639156 100644 --- a/spec/operators/skipUntil-spec.ts +++ b/spec/operators/skipUntil-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/skipWhile-spec.ts b/spec/operators/skipWhile-spec.ts index 45bc82b3ab..83db88d5ef 100644 --- a/spec/operators/skipWhile-spec.ts +++ b/spec/operators/skipWhile-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/startWith-spec.ts b/spec/operators/startWith-spec.ts index c7dc300fc9..e95f1d587c 100644 --- a/spec/operators/startWith-spec.ts +++ b/spec/operators/startWith-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/subscribeOn-spec.ts b/spec/operators/subscribeOn-spec.ts index e668620a0e..4248a9370f 100644 --- a/spec/operators/subscribeOn-spec.ts +++ b/spec/operators/subscribeOn-spec.ts @@ -1,5 +1,10 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/switch-spec.ts b/spec/operators/switch-spec.ts index cbcc6dc77f..fd4135a2a0 100644 --- a/spec/operators/switch-spec.ts +++ b/spec/operators/switch-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; const queueScheduler = Rx.Scheduler.queue; diff --git a/spec/operators/switchMap-spec.ts b/spec/operators/switchMap-spec.ts index d30158ef39..6fd4236847 100644 --- a/spec/operators/switchMap-spec.ts +++ b/spec/operators/switchMap-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/switchMapTo-spec.ts b/spec/operators/switchMapTo-spec.ts index 13d2d6e524..666c7d7ad0 100644 --- a/spec/operators/switchMapTo-spec.ts +++ b/spec/operators/switchMapTo-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/take-spec.ts b/spec/operators/take-spec.ts index 5686bd4b12..79a532ddd8 100644 --- a/spec/operators/take-spec.ts +++ b/spec/operators/take-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Subject = Rx.Subject; const Observable = Rx.Observable; diff --git a/spec/operators/takeLast-spec.ts b/spec/operators/takeLast-spec.ts index a98f289a7f..572e22acb6 100644 --- a/spec/operators/takeLast-spec.ts +++ b/spec/operators/takeLast-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/takeUntil-spec.ts b/spec/operators/takeUntil-spec.ts index 07622bba53..b2a2288409 100644 --- a/spec/operators/takeUntil-spec.ts +++ b/spec/operators/takeUntil-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/takeWhile-spec.ts b/spec/operators/takeWhile-spec.ts index 69f4c215a8..067187df46 100644 --- a/spec/operators/takeWhile-spec.ts +++ b/spec/operators/takeWhile-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; /** @test {takeWhile} */ diff --git a/spec/operators/throttle-spec.ts b/spec/operators/throttle-spec.ts index 2fb85c721f..bdbefa4bcf 100644 --- a/spec/operators/throttle-spec.ts +++ b/spec/operators/throttle-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/throttleTime-spec.ts b/spec/operators/throttleTime-spec.ts index eb8316ba7c..3c40c6ffc1 100644 --- a/spec/operators/throttleTime-spec.ts +++ b/spec/operators/throttleTime-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/timeInterval-spec.ts b/spec/operators/timeInterval-spec.ts index 8b86e54544..0157fac3df 100644 --- a/spec/operators/timeInterval-spec.ts +++ b/spec/operators/timeInterval-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/timeout-spec.ts b/spec/operators/timeout-spec.ts index 167bf3dbd8..814ac7e4a8 100644 --- a/spec/operators/timeout-spec.ts +++ b/spec/operators/timeout-spec.ts @@ -1,6 +1,12 @@ import * as Rx from '../../dist/cjs/Rx'; import { expect } from 'chai'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/timeoutWith-spec.ts b/spec/operators/timeoutWith-spec.ts index fad796032f..25fca612c7 100644 --- a/spec/operators/timeoutWith-spec.ts +++ b/spec/operators/timeoutWith-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/timestamp-spec.ts b/spec/operators/timestamp-spec.ts index d3a071b961..12494d0a43 100644 --- a/spec/operators/timestamp-spec.ts +++ b/spec/operators/timestamp-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/toArray-spec.ts b/spec/operators/toArray-spec.ts index 1d4baf891d..f9b0833bc3 100644 --- a/spec/operators/toArray-spec.ts +++ b/spec/operators/toArray-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions, type}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, type }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/window-spec.ts b/spec/operators/window-spec.ts index 3446fbfb9e..453f25227d 100644 --- a/spec/operators/window-spec.ts +++ b/spec/operators/window-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, time, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, time }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/windowCount-spec.ts b/spec/operators/windowCount-spec.ts index 6eb9c03a53..b054f9da53 100644 --- a/spec/operators/windowCount-spec.ts +++ b/spec/operators/windowCount-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, time, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, time }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/windowTime-spec.ts b/spec/operators/windowTime-spec.ts index 5aff47d00c..7709c38660 100644 --- a/spec/operators/windowTime-spec.ts +++ b/spec/operators/windowTime-spec.ts @@ -1,6 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, time, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +declare const { asDiagram, time }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/windowToggle-spec.ts b/spec/operators/windowToggle-spec.ts index 67e29c4d49..4d81c52b13 100644 --- a/spec/operators/windowToggle-spec.ts +++ b/spec/operators/windowToggle-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, time, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, time }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/windowWhen-spec.ts b/spec/operators/windowWhen-spec.ts index 934c21308a..8cd36947ae 100644 --- a/spec/operators/windowWhen-spec.ts +++ b/spec/operators/windowWhen-spec.ts @@ -1,5 +1,11 @@ import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, time, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram, time }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/withLatestFrom-spec.ts b/spec/operators/withLatestFrom-spec.ts index 79a1c5cbec..48b9627030 100644 --- a/spec/operators/withLatestFrom-spec.ts +++ b/spec/operators/withLatestFrom-spec.ts @@ -1,7 +1,13 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; import {lowerCaseO} from '../helpers/test-helper'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; const Observable = Rx.Observable; diff --git a/spec/operators/zip-spec.ts b/spec/operators/zip-spec.ts index a62402d2e9..612d705603 100644 --- a/spec/operators/zip-spec.ts +++ b/spec/operators/zip-spec.ts @@ -1,6 +1,11 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const Symbol: any; const Observable = Rx.Observable; diff --git a/spec/operators/zipAll-spec.ts b/spec/operators/zipAll-spec.ts index a013b30116..d122416160 100644 --- a/spec/operators/zipAll-spec.ts +++ b/spec/operators/zipAll-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, asDiagram, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { asDiagram }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const Symbol: any; const Observable = Rx.Observable; diff --git a/spec/schedulers/TestScheduler-spec.ts b/spec/schedulers/TestScheduler-spec.ts index 79c83311b0..fe316e8913 100644 --- a/spec/schedulers/TestScheduler-spec.ts +++ b/spec/schedulers/TestScheduler-spec.ts @@ -1,6 +1,12 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, cold, time, expectObservable, expectSubscriptions}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { time }; +declare const hot: typeof marbleTestingSignature.hot; +declare const cold: typeof marbleTestingSignature.cold; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; declare const rxTestScheduler: Rx.TestScheduler; const Notification = Rx.Notification; diff --git a/spec/subjects/BehaviorSubject-spec.ts b/spec/subjects/BehaviorSubject-spec.ts index 5c87fa0679..c5c801383c 100644 --- a/spec/subjects/BehaviorSubject-spec.ts +++ b/spec/subjects/BehaviorSubject-spec.ts @@ -1,6 +1,10 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; -declare const {hot, expectObservable}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const { time }; +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; const BehaviorSubject = Rx.BehaviorSubject; const Observable = Rx.Observable; diff --git a/spec/subjects/ReplaySubject-spec.ts b/spec/subjects/ReplaySubject-spec.ts index 4852c5987d..08a8945b2a 100644 --- a/spec/subjects/ReplaySubject-spec.ts +++ b/spec/subjects/ReplaySubject-spec.ts @@ -1,7 +1,10 @@ import {expect} from 'chai'; import * as Rx from '../../dist/cjs/Rx'; import {TestScheduler} from '../../dist/cjs/testing/TestScheduler'; -declare const {hot, expectObservable}; +import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports + +declare const hot: typeof marbleTestingSignature.hot; +declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: TestScheduler;