From 2b6fa847873869d00b1407985b9a57f054df314f Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Fri, 26 Jan 2018 06:58:04 -0500 Subject: [PATCH] refactor(test): updated test helpers to be strongly typed this allows tests to pick more on variation in type definitions when tests are being built updated danger script to change how it finds cold and hot signatures allow clrf files to be transparently converted to lf --- .gitattributes | 2 + .markdown-doctest-setup.js | 1 + dangerfile.js | 4 +- spec/Notification-spec.ts | 3 +- spec/Observable-spec.ts | 5 +- spec/Subject-spec.ts | 6 +- spec/helpers/marble-testing.ts | 8 +- .../observables/SubscribeOnObservable-spec.ts | 5 +- spec/observables/combineLatest-spec.ts | 12 +- spec/observables/concat-spec.ts | 19 +- spec/observables/defer-spec.ts | 8 +- spec/observables/dom/ajax-spec.ts | 2 +- spec/observables/empty-spec.ts | 3 +- spec/observables/forkJoin-spec.ts | 9 +- spec/observables/fromEvent-spec.ts | 5 +- spec/observables/fromEventPattern-spec.ts | 6 +- spec/observables/generate-spec.ts | 3 +- spec/observables/if-spec.ts | 4 +- spec/observables/interval-spec.ts | 3 +- spec/observables/merge-spec.ts | 7 +- spec/observables/never-spec.ts | 3 +- spec/observables/of-spec.ts | 7 +- spec/observables/onErrorResumeNext-spec.ts | 94 ++-- spec/observables/pairs-spec.ts | 4 +- spec/observables/race-spec.ts | 7 +- spec/observables/range-spec.ts | 3 +- spec/observables/throwError-spec.ts | 8 +- spec/observables/timer-spec.ts | 5 +- spec/observables/zip-spec.ts | 8 +- spec/operators/audit-spec.ts | 8 +- spec/operators/auditTime-spec.ts | 8 +- spec/operators/buffer-spec.ts | 7 +- spec/operators/bufferCount-spec.ts | 7 +- spec/operators/bufferTime-spec.ts | 8 +- spec/operators/bufferToggle-spec.ts | 8 +- spec/operators/bufferWhen-spec.ts | 8 +- spec/operators/catch-spec.ts | 8 +- spec/operators/combineAll-spec.ts | 8 +- spec/operators/combineLatest-spec.ts | 8 +- spec/operators/concat-spec.ts | 8 +- spec/operators/concatAll-spec.ts | 9 +- spec/operators/concatMap-spec.ts | 9 +- spec/operators/concatMapTo-spec.ts | 9 +- spec/operators/count-spec.ts | 9 +- spec/operators/debounce-spec.ts | 9 +- spec/operators/debounceTime-spec.ts | 8 +- spec/operators/defaultIfEmpty-spec.ts | 9 +- spec/operators/delay-spec.ts | 8 +- spec/operators/delayWhen-spec.ts | 9 +- spec/operators/dematerialize-spec.ts | 8 +- spec/operators/distinct-spec.ts | 432 +++++++++--------- spec/operators/distinctUntilChanged-spec.ts | 8 +- .../operators/distinctUntilKeyChanged-spec.ts | 8 +- spec/operators/do-spec.ts | 8 +- spec/operators/elementAt-spec.ts | 8 +- spec/operators/every-spec.ts | 8 +- spec/operators/exhaust-spec.ts | 8 +- spec/operators/exhaustMap-spec.ts | 8 +- spec/operators/expand-spec.ts | 8 +- spec/operators/filter-spec.ts | 8 +- spec/operators/finally-spec.ts | 8 +- spec/operators/find-spec.ts | 8 +- spec/operators/findIndex-spec.ts | 8 +- spec/operators/first-spec.ts | 7 +- spec/operators/groupBy-spec.ts | 8 +- spec/operators/ignoreElements-spec.ts | 8 +- spec/operators/isEmpty-spec.ts | 8 +- spec/operators/last-spec.ts | 8 +- spec/operators/map-spec.ts | 8 +- spec/operators/mapTo-spec.ts | 8 +- spec/operators/materialize-spec.ts | 8 +- spec/operators/max-spec.ts | 8 +- spec/operators/merge-spec.ts | 8 +- spec/operators/mergeAll-spec.ts | 8 +- spec/operators/mergeMap-spec.ts | 9 +- spec/operators/mergeMapTo-spec.ts | 10 +- spec/operators/mergeScan-spec.ts | 7 +- spec/operators/min-spec.ts | 8 +- spec/operators/multicast-spec.ts | 12 +- spec/operators/observeOn-spec.ts | 7 +- spec/operators/onErrorResumeNext-spec.ts | 8 +- spec/operators/pairwise-spec.ts | 8 +- spec/operators/partition-spec.ts | 8 +- spec/operators/pluck-spec.ts | 7 +- spec/operators/publish-spec.ts | 8 +- spec/operators/publishBehavior-spec.ts | 8 +- spec/operators/publishLast-spec.ts | 8 +- spec/operators/publishReplay-spec.ts | 8 +- spec/operators/race-spec.ts | 7 +- spec/operators/reduce-spec.ts | 9 +- spec/operators/refCount-spec.ts | 7 +- spec/operators/repeat-spec.ts | 7 +- spec/operators/repeatWhen-spec.ts | 8 +- spec/operators/retry-spec.ts | 8 +- spec/operators/retryWhen-spec.ts | 8 +- spec/operators/sample-spec.ts | 7 +- spec/operators/sampleTime-spec.ts | 8 +- spec/operators/scan-spec.ts | 9 +- spec/operators/sequenceEqual-spec.ts | 10 +- spec/operators/share-spec.ts | 8 +- spec/operators/shareReplay-spec.ts | 12 +- spec/operators/single-spec.ts | 7 +- spec/operators/skip-spec.ts | 8 +- spec/operators/skipLast-spec.ts | 8 +- spec/operators/skipUntil-spec.ts | 8 +- spec/operators/skipWhile-spec.ts | 8 +- spec/operators/startWith-spec.ts | 8 +- spec/operators/subscribeOn-spec.ts | 7 +- spec/operators/switch-spec.ts | 8 +- spec/operators/switchMap-spec.ts | 8 +- spec/operators/switchMapTo-spec.ts | 8 +- spec/operators/take-spec.ts | 8 +- spec/operators/takeLast-spec.ts | 8 +- spec/operators/takeUntil-spec.ts | 8 +- spec/operators/takeWhile-spec.ts | 8 +- spec/operators/throttle-spec.ts | 8 +- spec/operators/throttleTime-spec.ts | 11 +- spec/operators/timeInterval-spec.ts | 8 +- spec/operators/timeout-spec.ts | 8 +- spec/operators/timeoutWith-spec.ts | 8 +- spec/operators/timestamp-spec.ts | 300 ++++++------ spec/operators/toArray-spec.ts | 9 +- spec/operators/window-spec.ts | 9 +- spec/operators/windowCount-spec.ts | 9 +- spec/operators/windowTime-spec.ts | 12 +- spec/operators/windowToggle-spec.ts | 9 +- spec/operators/windowWhen-spec.ts | 9 +- spec/operators/withLatestFrom-spec.ts | 8 +- spec/operators/zip-spec.ts | 6 +- spec/operators/zipAll-spec.ts | 8 +- spec/schedulers/TestScheduler-spec.ts | 8 +- spec/subjects/BehaviorSubject-spec.ts | 6 +- spec/subjects/ReplaySubject-spec.ts | 5 +- spec/tsconfig.json | 6 + 134 files changed, 688 insertions(+), 1135 deletions(-) create mode 100644 .gitattributes create mode 100644 spec/tsconfig.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..bdf28e582a5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# no eol conversions! +* -text diff --git a/.markdown-doctest-setup.js b/.markdown-doctest-setup.js index 6afba751e54..9319f613d67 100644 --- a/.markdown-doctest-setup.js +++ b/.markdown-doctest-setup.js @@ -29,6 +29,7 @@ module.exports = { } } }, + emptySubs: marbleTesting.emptySubs, hot: marbleTesting.hot, cold: marbleTesting.cold, expectObservable: marbleTesting.expectObservable, diff --git a/dangerfile.js b/dangerfile.js index 95d17170bee..4a2d0b1167d 100644 --- a/dangerfile.js +++ b/dangerfile.js @@ -7,10 +7,10 @@ var validateMessage = require('validate-commit-msg'); //simple regex matcher to detect usage of helper function and its type signature var hotMatch = /\bhot\(/gi; -var hotSignatureMatch = /\bdeclare const hot: typeof/gi; +var hotSignatureMatch = /\bimport \{.*?hot.*?\} from '.*?\/helpers\/marble-testing'/gi; var coldMatch = /\bcold\(/gi; -var coldSignatureMatch = /\bdeclare const cold: typeof/gi; +var coldSignatureMatch = /\bimport \{.*?cold.*?\} from '.*?\/helpers\/marble-testing'/gi; var errorCount = 0; diff --git a/spec/Notification-spec.ts b/spec/Notification-spec.ts index faeb92d2ff5..b59f1d6ff3d 100644 --- a/spec/Notification-spec.ts +++ b/spec/Notification-spec.ts @@ -1,8 +1,7 @@ import { expect } from 'chai'; import * as Rx from '../src/Rx'; -import marbleTestingSignature = require('./helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { expectObservable } from './helpers/marble-testing'; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; const Notification = Rx.Notification; /** @test {Notification} */ diff --git a/spec/Observable-spec.ts b/spec/Observable-spec.ts index 27f0bed29f9..1de21a4bee6 100644 --- a/spec/Observable-spec.ts +++ b/spec/Observable-spec.ts @@ -3,15 +3,12 @@ import * as sinon from 'sinon'; import * as Rx from '../src/Rx'; import { Observer } from './../src/internal/Observer'; import { TeardownLogic } from '../src/internal/Subscription'; -import marbleTestingSignature = require('./helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { cold, expectObservable, expectSubscriptions } from './helpers/marble-testing'; import { map } from '../src/internal/operators/map'; //tslint:disable-next-line require('./helpers/test-helper'); declare const asDiagram: any, rxTestScheduler: any; -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/Subject-spec.ts b/spec/Subject-spec.ts index 8bc1e19d190..2ea12c3289a 100644 --- a/spec/Subject-spec.ts +++ b/spec/Subject-spec.ts @@ -1,10 +1,6 @@ import { expect } from 'chai'; import * as Rx from '../src/Rx'; -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; +import { hot, expectObservable } from './helpers/marble-testing'; const Subject = Rx.Subject; const Observable = Rx.Observable; diff --git a/spec/helpers/marble-testing.ts b/spec/helpers/marble-testing.ts index 4994b16e6d4..cfc6149a7d5 100644 --- a/spec/helpers/marble-testing.ts +++ b/spec/helpers/marble-testing.ts @@ -8,13 +8,19 @@ declare const global: any; export const rxTestScheduler: TestScheduler = global.rxTestScheduler; -export function hot(marbles: string, values?: any, error?: any): HotObservable { +export const emptySubs: any[] = []; + +export function hot(marbles: string, values?: void, error?: any): HotObservable; +export function hot(marbles: string, values?: { [index: string]: V; }, error?: any): HotObservable; +export function hot(marbles: string, values?: { [index: string]: V; } | void, error?: any): HotObservable { if (!global.rxTestScheduler) { throw 'tried to use hot() in async test'; } return global.rxTestScheduler.createHotObservable.apply(global.rxTestScheduler, arguments); } +export function cold(marbles: string, values?: void, error?: any): ColdObservable; +export function cold(marbles: string, values?: { [index: string]: V; }, error?: any): ColdObservable; export function cold(marbles: string, values?: any, error?: any): ColdObservable { if (!global.rxTestScheduler) { throw 'tried to use cold() in async test'; diff --git a/spec/observables/SubscribeOnObservable-spec.ts b/spec/observables/SubscribeOnObservable-spec.ts index 9a1460b5487..cb37bd11670 100644 --- a/spec/observables/SubscribeOnObservable-spec.ts +++ b/spec/observables/SubscribeOnObservable-spec.ts @@ -2,11 +2,8 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; import * as Rx from '../../src/Rx'; import { SubscribeOnObservable } from '../../src/internal/observable/SubscribeOnObservable'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 c743d3625f8..960fdf78ed0 100644 --- a/spec/observables/combineLatest-spec.ts +++ b/spec/observables/combineLatest-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 type: Function; const Observable = Rx.Observable; const queueScheduler = Rx.Scheduler.queue; @@ -516,7 +512,7 @@ describe('Observable.combineLatest', () => { let a: Promise[]; let o1: Rx.Observable = Observable.combineLatest(a); let o2: Rx.Observable = Observable.combineLatest(...a); - let o3: Rx.Observable = Observable.combineLatest(a, (...x) => x.length); + let o3: Rx.Observable = Observable.combineLatest(a, (...x: any[]) => x.length); /* tslint:enable:no-unused-variable */ }); @@ -525,7 +521,7 @@ describe('Observable.combineLatest', () => { let a: Rx.Observable[]; let o1: Rx.Observable = Observable.combineLatest(a); let o2: Rx.Observable = Observable.combineLatest(...a); - let o3: Rx.Observable = Observable.combineLatest(a, (...x) => x.length); + let o3: Rx.Observable = Observable.combineLatest(a, (...x: any[]) => x.length); /* tslint:enable:no-unused-variable */ }); diff --git a/spec/observables/concat-spec.ts b/spec/observables/concat-spec.ts index 0da4bb15b7f..557059f6581 100644 --- a/spec/observables/concat-spec.ts +++ b/spec/observables/concat-spec.ts @@ -1,12 +1,7 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; import { lowerCaseO } from '../helpers/test-helper'; -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; +import { hot, cold, emptySubs, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; const Observable = Rx.Observable; const queueScheduler = Rx.Scheduler.queue; @@ -88,7 +83,7 @@ describe('Observable.concat', () => { const e1 = cold('-'); const e1subs = '^'; const e2 = cold('--|'); - const e2subs = []; + const e2subs = emptySubs; const expected = '-'; expectObservable(Observable.concat(e1, e2)).toBe(expected); @@ -112,7 +107,7 @@ describe('Observable.concat', () => { const e1 = cold('-'); const e1subs = '^'; const e2 = cold('-'); - const e2subs = []; + const e2subs = emptySubs; const expected = '-'; expectObservable(Observable.concat(e1, e2)).toBe(expected); @@ -136,7 +131,7 @@ describe('Observable.concat', () => { const e1 = cold('---#'); const e1subs = '^ !'; const e2 = cold('----|'); - const e2subs = []; + const e2subs = emptySubs; const expected = '---#'; expectObservable(Observable.concat(e1, e2)).toBe(expected); @@ -148,7 +143,7 @@ describe('Observable.concat', () => { const e1 = cold('---#'); const e1subs = '^ !'; const e2 = cold('------#'); - const e2subs = []; + const e2subs = emptySubs; const expected = '---#'; expectObservable(Observable.concat(e1, e2)).toBe(expected); @@ -197,7 +192,7 @@ describe('Observable.concat', () => { const e1 = cold('-'); const e1subs = '^'; const e2 = cold('--a--|'); - const e2subs = []; + const e2subs = emptySubs; const expected = '-'; expectObservable(Observable.concat(e1, e2)).toBe(expected); @@ -234,7 +229,7 @@ describe('Observable.concat', () => { const e1 = cold('--#'); const e1subs = '^ !'; const e2 = cold('----a--|'); - const e2subs = []; + const e2subs = emptySubs; const expected = '--#'; expectObservable(Observable.concat(e1, e2)).toBe(expected); diff --git a/spec/observables/defer-spec.ts b/spec/observables/defer-spec.ts index 16a3fabc30f..93bac17bf77 100644 --- a/spec/observables/defer-spec.ts +++ b/spec/observables/defer-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports import { defer } from '../../src/'; import { Observable } from '../../src'; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const asDiagram: any; -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 function asDiagram(arg: string): Function; /** @test {defer} */ describe('defer', () => { diff --git a/spec/observables/dom/ajax-spec.ts b/spec/observables/dom/ajax-spec.ts index d865f11453f..58dcbb28b77 100644 --- a/spec/observables/dom/ajax-spec.ts +++ b/spec/observables/dom/ajax-spec.ts @@ -230,7 +230,7 @@ describe('Observable.ajax', () => { }); it('should fail on 404', () => { - let error; + let error: any; const obj = { url: '/flibbertyJibbet', normalizeError: (e: any, xhr: any, type: any) => { diff --git a/spec/observables/empty-spec.ts b/spec/observables/empty-spec.ts index bd450f631a0..ed20c3087c8 100644 --- a/spec/observables/empty-spec.ts +++ b/spec/observables/empty-spec.ts @@ -1,10 +1,9 @@ -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { expectObservable } from '../helpers/marble-testing'; import { empty } from '../../src/'; import { EMPTY } from '../../src'; import { expect } from 'chai'; declare const asDiagram: any; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: any; /** @test {empty} */ diff --git a/spec/observables/forkJoin-spec.ts b/spec/observables/forkJoin-spec.ts index 73b8b140754..98f4c1f5314 100644 --- a/spec/observables/forkJoin-spec.ts +++ b/spec/observables/forkJoin-spec.ts @@ -1,13 +1,10 @@ import { expect } from 'chai'; import { Observable, forkJoin, of } from '../../src'; import { lowerCaseO } from '../helpers/test-helper'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const type: any; -declare const asDiagram: any; -declare const hot: typeof marbleTestingSignature.hot; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare const type: Function; +declare const asDiagram: Function; /** @test {forkJoin} */ describe('forkJoin', () => { diff --git a/spec/observables/fromEvent-spec.ts b/spec/observables/fromEvent-spec.ts index 66f463d4429..b1de0912fb5 100644 --- a/spec/observables/fromEvent-spec.ts +++ b/spec/observables/fromEvent-spec.ts @@ -1,9 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { expectObservable } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; +declare function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/fromEventPattern-spec.ts b/spec/observables/fromEventPattern-spec.ts index a0f87d9eddf..642baf437e6 100644 --- a/spec/observables/fromEventPattern-spec.ts +++ b/spec/observables/fromEventPattern-spec.ts @@ -2,11 +2,9 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; import * as Rx from '../../src/Rx'; import { noop } from '../../src/internal/util/noop'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports - -declare const { asDiagram }; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; +import { expectObservable } from '../helpers/marble-testing'; +declare function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/generate-spec.ts b/spec/observables/generate-spec.ts index 30b1f88c943..4bd53e960fa 100644 --- a/spec/observables/generate-spec.ts +++ b/spec/observables/generate-spec.ts @@ -2,7 +2,8 @@ import * as Rx from '../../src/Rx'; import '../../src/add/observable/generate'; import { TestScheduler } from '../../src/internal/testing/TestScheduler'; import { expect } from 'chai'; -declare const {asDiagram, expectObservable}; +import { expectObservable } from '../helpers/marble-testing'; +declare function asDiagram(arg: string): Function; declare const rxTestScheduler: TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/if-spec.ts b/spec/observables/if-spec.ts index 22ca35e49a8..2ac514269e0 100644 --- a/spec/observables/if-spec.ts +++ b/spec/observables/if-spec.ts @@ -1,8 +1,6 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports - -declare const expectObservable: typeof marbleTestingSignature.expectObservable; +import { expectObservable } from '../helpers/marble-testing'; const Observable = Rx.Observable; diff --git a/spec/observables/interval-spec.ts b/spec/observables/interval-spec.ts index 200f4040223..d44ecaab8a4 100644 --- a/spec/observables/interval-spec.ts +++ b/spec/observables/interval-spec.ts @@ -1,12 +1,11 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { expectObservable } from '../helpers/marble-testing'; import { asapScheduler, Observable, animationFrameScheduler, queueScheduler } from '../../src'; import { TestScheduler } from '../../src/testing'; import { interval } from '../../src/'; declare const asDiagram: any; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: TestScheduler; /** @test {interval} */ diff --git a/spec/observables/merge-spec.ts b/spec/observables/merge-spec.ts index 2147d2849e1..bba94bf433d 100644 --- a/spec/observables/merge-spec.ts +++ b/spec/observables/merge-spec.ts @@ -1,12 +1,7 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; import { lowerCaseO } from '../helpers/test-helper'; -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; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/never-spec.ts b/spec/observables/never-spec.ts index ee158b095f6..bfeda333a3f 100644 --- a/spec/observables/never-spec.ts +++ b/spec/observables/never-spec.ts @@ -1,9 +1,8 @@ import { never } from '../../src/'; import { expect } from 'chai'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { expectObservable } from '../helpers/marble-testing'; declare const asDiagram: any; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; /** @test {never} */ describe('never', () => { diff --git a/spec/observables/of-spec.ts b/spec/observables/of-spec.ts index a0a78a1fb12..dcfd73722ff 100644 --- a/spec/observables/of-spec.ts +++ b/spec/observables/of-spec.ts @@ -1,9 +1,10 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; import { empty } from '../../src/internal/observable/empty'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports -declare const asDiagram: any; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; +import { expectObservable } from '../helpers/marble-testing'; + +declare function asDiagram(arg: string): Function; + declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/observables/onErrorResumeNext-spec.ts b/spec/observables/onErrorResumeNext-spec.ts index bee293b8570..a8ea4688876 100644 --- a/spec/observables/onErrorResumeNext-spec.ts +++ b/spec/observables/onErrorResumeNext-spec.ts @@ -1,54 +1,40 @@ -import { onErrorResumeNext } from '../../src/'; -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; - -describe('onErrorResumeNext', () => { - it('should continue with observables', () => { - const s1 = hot('--a--b--#'); - const s2 = cold( '--c--d--#'); - const s3 = cold( '--e--#'); - const s4 = cold( '--f--g--|'); - const subs1 = '^ !'; - const subs2 = ' ^ !'; - const subs3 = ' ^ !'; - const subs4 = ' ^ !'; - const expected = '--a--b----c--d----e----f--g--|'; - - expectObservable(onErrorResumeNext(s1, s2, s3, s4)).toBe(expected); - expectSubscriptions(s1.subscriptions).toBe(subs1); - expectSubscriptions(s2.subscriptions).toBe(subs2); - expectSubscriptions(s3.subscriptions).toBe(subs3); - expectSubscriptions(s4.subscriptions).toBe(subs4); - }); - - it('should continue array of observables', () => { - const s1 = hot('--a--b--#'); - const s2 = cold( '--c--d--#'); - const s3 = cold( '--e--#'); - const s4 = cold( '--f--g--|'); - const subs1 = '^ !'; - const subs2 = ' ^ !'; - const subs3 = ' ^ !'; - const subs4 = ' ^ !'; - const expected = '--a--b----c--d----e----f--g--|'; - - expectObservable(onErrorResumeNext([s1, s2, s3, s4])).toBe(expected); - expectSubscriptions(s1.subscriptions).toBe(subs1); - expectSubscriptions(s2.subscriptions).toBe(subs2); - expectSubscriptions(s3.subscriptions).toBe(subs3); - expectSubscriptions(s4.subscriptions).toBe(subs4); - }); - - it('should complete single observable throws', () => { - const source = hot('#'); - const subs = '(^!)'; - const expected = '|'; - - expectObservable(onErrorResumeNext(source)).toBe(expected); - expectSubscriptions(source.subscriptions).toBe(subs); - }); -}); +import * as Rx from '../../src/Rx'; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +const Observable = Rx.Observable; + +describe('Observable.onErrorResumeNext', () => { + it('should continue with observables', () => { + const source = hot('--a--b--#'); + const next1 = cold( '--c--d--#'); + const next2 = cold( '--e--#'); + const next3 = cold( '--f--g--|'); + const subs = '^ !'; + const expected = '--a--b----c--d----e----f--g--|'; + + expectObservable(Observable.onErrorResumeNext(source, next1, next2, next3)).toBe(expected); + expectSubscriptions(source.subscriptions).toBe(subs); + }); + + it('should continue array of observables', () => { + const source = hot('--a--b--#'); + const next = [ source, + cold( '--c--d--#'), + cold( '--e--#'), + cold( '--f--g--|')]; + const subs = '^ !'; + const expected = '--a--b----c--d----e----f--g--|'; + + expectObservable(Observable.onErrorResumeNext(next)).toBe(expected); + expectSubscriptions(source.subscriptions).toBe(subs); + }); + + it('should complete single observable throws', () => { + const source = hot('#'); + const subs = '(^!)'; + const expected = '|'; + + expectObservable(Observable.onErrorResumeNext(source)).toBe(expected); + expectSubscriptions(source.subscriptions).toBe(subs); + }); +}); diff --git a/spec/observables/pairs-spec.ts b/spec/observables/pairs-spec.ts index e088519406e..f3386eceec0 100644 --- a/spec/observables/pairs-spec.ts +++ b/spec/observables/pairs-spec.ts @@ -1,10 +1,10 @@ import { expect } from 'chai'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { expectObservable } from '../helpers/marble-testing'; import { TestScheduler } from '../../src/testing'; import { pairs } from '../../src/'; declare const asDiagram: any; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; + declare const rxTestScheduler: TestScheduler; describe('pairs', () => { diff --git a/spec/observables/race-spec.ts b/spec/observables/race-spec.ts index b2eaa1f7c2e..839adf2abc5 100644 --- a/spec/observables/race-spec.ts +++ b/spec/observables/race-spec.ts @@ -1,10 +1,5 @@ import * as Rx from '../../src/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; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; const Observable = Rx.Observable; diff --git a/spec/observables/range-spec.ts b/spec/observables/range-spec.ts index 9a65cb959be..8a989ee4d78 100644 --- a/spec/observables/range-spec.ts +++ b/spec/observables/range-spec.ts @@ -3,12 +3,11 @@ import * as sinon from 'sinon'; import { Observable, asapScheduler as asap} from '../../src'; import { range } from '../../src/'; import { TestScheduler } from '../../src/testing'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { expectObservable } from '../helpers/marble-testing'; import { dispatch } from '../../src/internal/observable/range'; import { Subscriber } from '../../src/internal/Subscriber'; declare const asDiagram: any; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: TestScheduler; diff --git a/spec/observables/throwError-spec.ts b/spec/observables/throwError-spec.ts index e03a6cebe53..970253af12b 100644 --- a/spec/observables/throwError-spec.ts +++ b/spec/observables/throwError-spec.ts @@ -1,10 +1,10 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import { throwError } from '../../src/'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { throwError } from '../../src/internal/observable/throwError'; +import { expectObservable } from '../helpers/marble-testing'; + +declare function asDiagram(arg: string): Function; -declare const asDiagram: any; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; declare const rxTestScheduler: Rx.TestScheduler; /** @test {throw} */ diff --git a/spec/observables/timer-spec.ts b/spec/observables/timer-spec.ts index 9cbf25319fb..a96300df629 100644 --- a/spec/observables/timer-spec.ts +++ b/spec/observables/timer-spec.ts @@ -1,12 +1,9 @@ -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { cold, expectObservable } from '../helpers/marble-testing'; import { timer, never, merge } from '../../src/'; import { TestScheduler } from '../../src/testing'; import { mergeMap } from '../../src/operators'; declare const asDiagram: any; -declare const time: typeof marbleTestingSignature.time; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const cold: typeof marbleTestingSignature.cold; declare const rxTestScheduler: TestScheduler; /** @test {timer} */ diff --git a/spec/observables/zip-spec.ts b/spec/observables/zip-spec.ts index 3f4680e4995..83e47ba4a94 100644 --- a/spec/observables/zip-spec.ts +++ b/spec/observables/zip-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 type: Function; declare const Symbol: any; diff --git a/spec/operators/audit-spec.ts b/spec/operators/audit-spec.ts index ebecd4cf86d..b490eedc37b 100644 --- a/spec/operators/audit-spec.ts +++ b/spec/operators/audit-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/auditTime-spec.ts b/spec/operators/auditTime-spec.ts index e9d53c05300..a1b558623ac 100644 --- a/spec/operators/auditTime-spec.ts +++ b/spec/operators/auditTime-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/buffer-spec.ts b/spec/operators/buffer-spec.ts index c70a13fb117..9559f058b6d 100644 --- a/spec/operators/buffer-spec.ts +++ b/spec/operators/buffer-spec.ts @@ -1,10 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const hot: typeof marbleTestingSignature.hot; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/bufferCount-spec.ts b/spec/operators/bufferCount-spec.ts index d1a0bb4f92d..ee89e44fa63 100644 --- a/spec/operators/bufferCount-spec.ts +++ b/spec/operators/bufferCount-spec.ts @@ -1,11 +1,8 @@ import * as Rx from '../../src/Rx'; import { expect } from 'chai'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const hot: typeof marbleTestingSignature.hot; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/bufferTime-spec.ts b/spec/operators/bufferTime-spec.ts index b3f729e2488..a6efbb7c8f7 100644 --- a/spec/operators/bufferTime-spec.ts +++ b/spec/operators/bufferTime-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions, time } from '../helpers/marble-testing'; -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 asDiagram: Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/bufferToggle-spec.ts b/spec/operators/bufferToggle-spec.ts index 2f54785a214..c0a606fb661 100644 --- a/spec/operators/bufferToggle-spec.ts +++ b/spec/operators/bufferToggle-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/bufferWhen-spec.ts b/spec/operators/bufferWhen-spec.ts index d42b7f0a0c3..024b9d19b2b 100644 --- a/spec/operators/bufferWhen-spec.ts +++ b/spec/operators/bufferWhen-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/catch-spec.ts b/spec/operators/catch-spec.ts index 13477fcfce6..9ca111a869e 100644 --- a/spec/operators/catch-spec.ts +++ b/spec/operators/catch-spec.ts @@ -2,13 +2,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; import * as sinon from 'sinon'; import { createObservableInputs } from '../helpers/test-helper'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; declare const rxTestSchdeuler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/combineAll-spec.ts b/spec/operators/combineAll-spec.ts index e30227e6f9c..d671002121f 100644 --- a/spec/operators/combineAll-spec.ts +++ b/spec/operators/combineAll-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; const queueScheduler = Rx.Scheduler.queue; diff --git a/spec/operators/combineLatest-spec.ts b/spec/operators/combineLatest-spec.ts index b4c942c8702..75a83235fd3 100644 --- a/spec/operators/combineLatest-spec.ts +++ b/spec/operators/combineLatest-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/concat-spec.ts b/spec/operators/concat-spec.ts index c6d6681b297..9ed6bd85987 100644 --- a/spec/operators/concat-spec.ts +++ b/spec/operators/concat-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/concatAll-spec.ts b/spec/operators/concatAll-spec.ts index 616c395e428..78af7c36d39 100644 --- a/spec/operators/concatAll-spec.ts +++ b/spec/operators/concatAll-spec.ts @@ -1,12 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +declare function asDiagram(arg: string): Function; -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 f0216973fd6..3331781e514 100644 --- a/spec/operators/concatMap-spec.ts +++ b/spec/operators/concatMap-spec.ts @@ -1,12 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +declare function asDiagram(arg: string): Function; -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 00fed8d222f..d17dea93ca9 100644 --- a/spec/operators/concatMapTo-spec.ts +++ b/spec/operators/concatMapTo-spec.ts @@ -1,12 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +declare function asDiagram(arg: string): Function; -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 afa813659e3..e761e968db0 100644 --- a/spec/operators/count-spec.ts +++ b/spec/operators/count-spec.ts @@ -1,12 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +declare function asDiagram(arg: string): Function; -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 8cbfa37bf74..3c782481a8b 100644 --- a/spec/operators/debounce-spec.ts +++ b/spec/operators/debounce-spec.ts @@ -1,13 +1,10 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; declare const type; -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 function asDiagram(arg: string): Function; + declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/debounceTime-spec.ts b/spec/operators/debounceTime-spec.ts index 7cf54778be8..a648f0ce6ca 100644 --- a/spec/operators/debounceTime-spec.ts +++ b/spec/operators/debounceTime-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; import { VirtualTimeScheduler } from '../../src/internal/scheduler/VirtualTimeScheduler'; -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 function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/defaultIfEmpty-spec.ts b/spec/operators/defaultIfEmpty-spec.ts index d591d64b3ad..def3e92491c 100644 --- a/spec/operators/defaultIfEmpty-spec.ts +++ b/spec/operators/defaultIfEmpty-spec.ts @@ -1,11 +1,8 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +declare function asDiagram(arg: string): Function; -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 40c4008da49..0518350efc4 100644 --- a/spec/operators/delay-spec.ts +++ b/spec/operators/delay-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions, time } from '../helpers/marble-testing'; -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 asDiagram: Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/delayWhen-spec.ts b/spec/operators/delayWhen-spec.ts index e666b7f95a2..ce52da351e9 100644 --- a/spec/operators/delayWhen-spec.ts +++ b/spec/operators/delayWhen-spec.ts @@ -1,12 +1,9 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; import { expect } from 'chai'; -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 function asDiagram(arg: string): Function; + declare const rxTestScheduler: Rx.TestScheduler; /** @test {delayWhen} */ diff --git a/spec/operators/dematerialize-spec.ts b/spec/operators/dematerialize-spec.ts index 4feef72ecd0..04d088e6df1 100644 --- a/spec/operators/dematerialize-spec.ts +++ b/spec/operators/dematerialize-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; const Notification = Rx.Notification; diff --git a/spec/operators/distinct-spec.ts b/spec/operators/distinct-spec.ts index 8cae1d7415d..512c5777117 100644 --- a/spec/operators/distinct-spec.ts +++ b/spec/operators/distinct-spec.ts @@ -1,219 +1,215 @@ -import * as Rx from '../../src/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); - }); +import * as Rx from '../../src/Rx'; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +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 50875f6003c..8e4d152244d 100644 --- a/spec/operators/distinctUntilChanged-spec.ts +++ b/spec/operators/distinctUntilChanged-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/distinctUntilKeyChanged-spec.ts b/spec/operators/distinctUntilKeyChanged-spec.ts index 4d537298a85..b3e5edd52b7 100644 --- a/spec/operators/distinctUntilKeyChanged-spec.ts +++ b/spec/operators/distinctUntilKeyChanged-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; /** @test {distinctUntilKeyChanged} */ describe('Observable.prototype.distinctUntilKeyChanged', () => { diff --git a/spec/operators/do-spec.ts b/spec/operators/do-spec.ts index 397686da837..728e889e1db 100644 --- a/spec/operators/do-spec.ts +++ b/spec/operators/do-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; const Subject = Rx.Subject; diff --git a/spec/operators/elementAt-spec.ts b/spec/operators/elementAt-spec.ts index f302ea0bd1c..c14abc50554 100644 --- a/spec/operators/elementAt-spec.ts +++ b/spec/operators/elementAt-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/every-spec.ts b/spec/operators/every-spec.ts index f80a1137158..169e8d2f506 100644 --- a/spec/operators/every-spec.ts +++ b/spec/operators/every-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/exhaust-spec.ts b/spec/operators/exhaust-spec.ts index cc36ffc2045..48d0035813a 100644 --- a/spec/operators/exhaust-spec.ts +++ b/spec/operators/exhaust-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/exhaustMap-spec.ts b/spec/operators/exhaustMap-spec.ts index 2fca97bd836..a5f9706e04e 100644 --- a/spec/operators/exhaustMap-spec.ts +++ b/spec/operators/exhaustMap-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/expand-spec.ts b/spec/operators/expand-spec.ts index 49e3af04557..72d2b20c37f 100644 --- a/spec/operators/expand-spec.ts +++ b/spec/operators/expand-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; declare const Symbol: any; declare const rxTestScheduler: Rx.TestScheduler; diff --git a/spec/operators/filter-spec.ts b/spec/operators/filter-spec.ts index 83ac581e33b..82d98c91fd0 100644 --- a/spec/operators/filter-spec.ts +++ b/spec/operators/filter-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/finally-spec.ts b/spec/operators/finally-spec.ts index 33b3ffc2063..00c5eb4223f 100644 --- a/spec/operators/finally-spec.ts +++ b/spec/operators/finally-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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; +declare const type: Function; const Observable = Rx.Observable; diff --git a/spec/operators/find-spec.ts b/spec/operators/find-spec.ts index 6ebdcb696cb..80798f8de4c 100644 --- a/spec/operators/find-spec.ts +++ b/spec/operators/find-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/findIndex-spec.ts b/spec/operators/findIndex-spec.ts index dba420e589d..cebea56e3b2 100644 --- a/spec/operators/findIndex-spec.ts +++ b/spec/operators/findIndex-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/first-spec.ts b/spec/operators/first-spec.ts index 8e4fdedb651..c170d34ef58 100644 --- a/spec/operators/first-spec.ts +++ b/spec/operators/first-spec.ts @@ -1,11 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const hot: typeof marbleTestingSignature.hot; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/groupBy-spec.ts b/spec/operators/groupBy-spec.ts index e48fe2cc1c4..6790ce69225 100644 --- a/spec/operators/groupBy-spec.ts +++ b/spec/operators/groupBy-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; import { GroupedObservable } from '../../src/internal/operators/groupBy'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/ignoreElements-spec.ts b/spec/operators/ignoreElements-spec.ts index 8ab327cb7d3..d49f0141f9c 100644 --- a/spec/operators/ignoreElements-spec.ts +++ b/spec/operators/ignoreElements-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/isEmpty-spec.ts b/spec/operators/isEmpty-spec.ts index 262896383b1..bcc66c6c0d5 100644 --- a/spec/operators/isEmpty-spec.ts +++ b/spec/operators/isEmpty-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; /** @test {isEmpty} */ describe('Observable.prototype.isEmpty', () => { diff --git a/spec/operators/last-spec.ts b/spec/operators/last-spec.ts index 131b0149b0a..a078eefba93 100644 --- a/spec/operators/last-spec.ts +++ b/spec/operators/last-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/map-spec.ts b/spec/operators/map-spec.ts index e296e485e41..500b257a13e 100644 --- a/spec/operators/map-spec.ts +++ b/spec/operators/map-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/mapTo-spec.ts b/spec/operators/mapTo-spec.ts index 39a0e3bdec3..74958e6e0d3 100644 --- a/spec/operators/mapTo-spec.ts +++ b/spec/operators/mapTo-spec.ts @@ -1,12 +1,8 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/materialize-spec.ts b/spec/operators/materialize-spec.ts index fb2c95ab6a3..a2daedc6f0a 100644 --- a/spec/operators/materialize-spec.ts +++ b/spec/operators/materialize-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; const Notification = Rx.Notification; diff --git a/spec/operators/max-spec.ts b/spec/operators/max-spec.ts index b8f995aab87..f84400b1d45 100644 --- a/spec/operators/max-spec.ts +++ b/spec/operators/max-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/merge-spec.ts b/spec/operators/merge-spec.ts index fdcc56e8239..060b40c84d4 100644 --- a/spec/operators/merge-spec.ts +++ b/spec/operators/merge-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/mergeAll-spec.ts b/spec/operators/mergeAll-spec.ts index 32654a18b0d..0483d79621a 100644 --- a/spec/operators/mergeAll-spec.ts +++ b/spec/operators/mergeAll-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/mergeMap-spec.ts b/spec/operators/mergeMap-spec.ts index 13f32067450..b803c35d696 100644 --- a/spec/operators/mergeMap-spec.ts +++ b/spec/operators/mergeMap-spec.ts @@ -1,12 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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; +declare const type: Function; +declare const asDiagram: Function; const Observable = Rx.Observable; diff --git a/spec/operators/mergeMapTo-spec.ts b/spec/operators/mergeMapTo-spec.ts index e83ab35f505..2c2737946d0 100644 --- a/spec/operators/mergeMapTo-spec.ts +++ b/spec/operators/mergeMapTo-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -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; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; +declare const type: Function; +declare const asDiagram: Function; const Observable = Rx.Observable; /** @test {mergeMapTo} */ diff --git a/spec/operators/mergeScan-spec.ts b/spec/operators/mergeScan-spec.ts index 90194db1ffa..e26d6515285 100644 --- a/spec/operators/mergeScan-spec.ts +++ b/spec/operators/mergeScan-spec.ts @@ -1,10 +1,5 @@ import * as Rx from '../../src/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; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/min-spec.ts b/spec/operators/min-spec.ts index 29555ebbe3b..7a1520cf69c 100644 --- a/spec/operators/min-spec.ts +++ b/spec/operators/min-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/multicast-spec.ts b/spec/operators/multicast-spec.ts index 164925138ce..afbd6ff019f 100644 --- a/spec/operators/multicast-spec.ts +++ b/spec/operators/multicast-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports - -declare const { asDiagram, time, rxTestScheduler }; -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; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +declare const type: Function; +declare const asDiagram: Function; const Observable = Rx.Observable; const Subject = Rx.Subject; diff --git a/spec/operators/observeOn-spec.ts b/spec/operators/observeOn-spec.ts index dcc181b917f..9dd562632d8 100644 --- a/spec/operators/observeOn-spec.ts +++ b/spec/operators/observeOn-spec.ts @@ -1,11 +1,8 @@ import * as Rx from '../../src/Rx'; import { expect } from 'chai'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const hot: typeof marbleTestingSignature.hot; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/onErrorResumeNext-spec.ts b/spec/operators/onErrorResumeNext-spec.ts index 86ced330819..f3a30300312 100644 --- a/spec/operators/onErrorResumeNext-spec.ts +++ b/spec/operators/onErrorResumeNext-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/pairwise-spec.ts b/spec/operators/pairwise-spec.ts index 06c20c053a4..22ed52d0dee 100644 --- a/spec/operators/pairwise-spec.ts +++ b/spec/operators/pairwise-spec.ts @@ -1,10 +1,6 @@ -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; /** @test {pairwise} */ describe('Observable.prototype.pairwise', () => { diff --git a/spec/operators/partition-spec.ts b/spec/operators/partition-spec.ts index 606c6a79bd1..09e2a7abc8b 100644 --- a/spec/operators/partition-spec.ts +++ b/spec/operators/partition-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/pluck-spec.ts b/spec/operators/pluck-spec.ts index 391958192b8..01b62cc5151 100644 --- a/spec/operators/pluck-spec.ts +++ b/spec/operators/pluck-spec.ts @@ -1,11 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const cold: typeof marbleTestingSignature.cold; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/publish-spec.ts b/spec/operators/publish-spec.ts index 97eb0793593..9354ee76cdc 100644 --- a/spec/operators/publish-spec.ts +++ b/spec/operators/publish-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; +declare function asDiagram(arg: string): Function; 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; diff --git a/spec/operators/publishBehavior-spec.ts b/spec/operators/publishBehavior-spec.ts index c69234aee99..c6ed1d5c43f 100644 --- a/spec/operators/publishBehavior-spec.ts +++ b/spec/operators/publishBehavior-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; +declare function asDiagram(arg: string): Function; 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; diff --git a/spec/operators/publishLast-spec.ts b/spec/operators/publishLast-spec.ts index 3b37ee5c84c..8d66b1ff372 100644 --- a/spec/operators/publishLast-spec.ts +++ b/spec/operators/publishLast-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; +declare function asDiagram(arg: string): Function; 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; diff --git a/spec/operators/publishReplay-spec.ts b/spec/operators/publishReplay-spec.ts index a15c9bb88a8..b0b99ae426b 100644 --- a/spec/operators/publishReplay-spec.ts +++ b/spec/operators/publishReplay-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; +declare function asDiagram(arg: string): Function; 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; diff --git a/spec/operators/race-spec.ts b/spec/operators/race-spec.ts index 24256c0e851..aa6c4e6f131 100644 --- a/spec/operators/race-spec.ts +++ b/spec/operators/race-spec.ts @@ -1,12 +1,7 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; import * as Rx from '../../src/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; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; const Observable = Rx.Observable; diff --git a/spec/operators/reduce-spec.ts b/spec/operators/reduce-spec.ts index 3ca91aac4c9..7a19d9ff692 100644 --- a/spec/operators/reduce-spec.ts +++ b/spec/operators/reduce-spec.ts @@ -1,12 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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; +declare const type: Function; +declare const asDiagram: Function; const Observable = Rx.Observable; diff --git a/spec/operators/refCount-spec.ts b/spec/operators/refCount-spec.ts index 4f88056c199..3c93fdd829f 100644 --- a/spec/operators/refCount-spec.ts +++ b/spec/operators/refCount-spec.ts @@ -1,11 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const cold: typeof marbleTestingSignature.cold; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/repeat-spec.ts b/spec/operators/repeat-spec.ts index aacc5d3e33f..f9c18eaa9b6 100644 --- a/spec/operators/repeat-spec.ts +++ b/spec/operators/repeat-spec.ts @@ -1,11 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const cold: typeof marbleTestingSignature.cold; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/repeatWhen-spec.ts b/spec/operators/repeatWhen-spec.ts index 6d1cfa321ea..2d450d0bd4a 100644 --- a/spec/operators/repeatWhen-spec.ts +++ b/spec/operators/repeatWhen-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/retry-spec.ts b/spec/operators/retry-spec.ts index e151cdf6bd0..157b4917c85 100644 --- a/spec/operators/retry-spec.ts +++ b/spec/operators/retry-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/retryWhen-spec.ts b/spec/operators/retryWhen-spec.ts index 0e8767861a2..4d46b32629e 100644 --- a/spec/operators/retryWhen-spec.ts +++ b/spec/operators/retryWhen-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/sample-spec.ts b/spec/operators/sample-spec.ts index b2666ccd466..911a0fd9643 100644 --- a/spec/operators/sample-spec.ts +++ b/spec/operators/sample-spec.ts @@ -1,12 +1,9 @@ import * as Rx from '../../src/Rx'; import { expect } from 'chai'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const hot: typeof marbleTestingSignature.hot; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/sampleTime-spec.ts b/spec/operators/sampleTime-spec.ts index c05be93d078..6462000c6dc 100644 --- a/spec/operators/sampleTime-spec.ts +++ b/spec/operators/sampleTime-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/scan-spec.ts b/spec/operators/scan-spec.ts index 8966baca900..5e26f2c75fa 100644 --- a/spec/operators/scan-spec.ts +++ b/spec/operators/scan-spec.ts @@ -1,12 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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; +declare const type: Function; +declare const asDiagram: Function; const Observable = Rx.Observable; diff --git a/spec/operators/sequenceEqual-spec.ts b/spec/operators/sequenceEqual-spec.ts index 5e386bcc15b..4a872eefd4d 100644 --- a/spec/operators/sequenceEqual-spec.ts +++ b/spec/operators/sequenceEqual-spec.ts @@ -1,12 +1,8 @@ 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; +import { hot, cold, expectObservable, expectSubscriptions, time } from '../helpers/marble-testing'; +declare const type: Function; +declare const asDiagram: Function; const booleans = { T: true, F: false }; /** @test {sequenceEqual} */ diff --git a/spec/operators/share-spec.ts b/spec/operators/share-spec.ts index 499977a5bf4..ff0e7a3d0c9 100644 --- a/spec/operators/share-spec.ts +++ b/spec/operators/share-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/shareReplay-spec.ts b/spec/operators/shareReplay-spec.ts index 91d6d0d1845..513e5ba5277 100644 --- a/spec/operators/shareReplay-spec.ts +++ b/spec/operators/shareReplay-spec.ts @@ -1,14 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -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 time: typeof marbleTestingSignature.time; -declare const rxTestScheduler: typeof marbleTestingSignature.rxTestScheduler; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +declare function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/single-spec.ts b/spec/operators/single-spec.ts index 3ff97b715d2..3899a53bd7e 100644 --- a/spec/operators/single-spec.ts +++ b/spec/operators/single-spec.ts @@ -1,11 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const hot: typeof marbleTestingSignature.hot; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare function asDiagram(arg: string): Function; const Observable = Rx.Observable; /** @test {single} */ diff --git a/spec/operators/skip-spec.ts b/spec/operators/skip-spec.ts index 1b0a3f02c1a..83d47089b47 100644 --- a/spec/operators/skip-spec.ts +++ b/spec/operators/skip-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/skipLast-spec.ts b/spec/operators/skipLast-spec.ts index ffdb61afd92..02993352105 100644 --- a/spec/operators/skipLast-spec.ts +++ b/spec/operators/skipLast-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/skipUntil-spec.ts b/spec/operators/skipUntil-spec.ts index 6b849cdeae9..f44c88d325e 100644 --- a/spec/operators/skipUntil-spec.ts +++ b/spec/operators/skipUntil-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/skipWhile-spec.ts b/spec/operators/skipWhile-spec.ts index 68330ed827e..09129e6ff58 100644 --- a/spec/operators/skipWhile-spec.ts +++ b/spec/operators/skipWhile-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/startWith-spec.ts b/spec/operators/startWith-spec.ts index 57d0522460c..b6fa6a48a31 100644 --- a/spec/operators/startWith-spec.ts +++ b/spec/operators/startWith-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/subscribeOn-spec.ts b/spec/operators/subscribeOn-spec.ts index 3924fc12eba..ad61ba73f78 100644 --- a/spec/operators/subscribeOn-spec.ts +++ b/spec/operators/subscribeOn-spec.ts @@ -1,10 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; -declare const hot: typeof marbleTestingSignature.hot; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; -declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions; +declare function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/switch-spec.ts b/spec/operators/switch-spec.ts index bcafd1d257f..bf250aefcbb 100644 --- a/spec/operators/switch-spec.ts +++ b/spec/operators/switch-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; const queueScheduler = Rx.Scheduler.queue; diff --git a/spec/operators/switchMap-spec.ts b/spec/operators/switchMap-spec.ts index ef9b47042dc..8afab6805ef 100644 --- a/spec/operators/switchMap-spec.ts +++ b/spec/operators/switchMap-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/switchMapTo-spec.ts b/spec/operators/switchMapTo-spec.ts index 1e3135002d0..c0707a353d8 100644 --- a/spec/operators/switchMapTo-spec.ts +++ b/spec/operators/switchMapTo-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/take-spec.ts b/spec/operators/take-spec.ts index 1f050457205..5327e79a40d 100644 --- a/spec/operators/take-spec.ts +++ b/spec/operators/take-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Subject = Rx.Subject; const Observable = Rx.Observable; diff --git a/spec/operators/takeLast-spec.ts b/spec/operators/takeLast-spec.ts index 03cb72ab0ad..78b40b8d8be 100644 --- a/spec/operators/takeLast-spec.ts +++ b/spec/operators/takeLast-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/takeUntil-spec.ts b/spec/operators/takeUntil-spec.ts index 0e438ef2b00..2bec8ffe557 100644 --- a/spec/operators/takeUntil-spec.ts +++ b/spec/operators/takeUntil-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/takeWhile-spec.ts b/spec/operators/takeWhile-spec.ts index 47733ea2847..d458bb9b046 100644 --- a/spec/operators/takeWhile-spec.ts +++ b/spec/operators/takeWhile-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; /** @test {takeWhile} */ diff --git a/spec/operators/throttle-spec.ts b/spec/operators/throttle-spec.ts index 24210dab6ba..b705df54156 100644 --- a/spec/operators/throttle-spec.ts +++ b/spec/operators/throttle-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; declare const type; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/throttleTime-spec.ts b/spec/operators/throttleTime-spec.ts index 6b8d93cb7fc..b05dccf4fd5 100644 --- a/spec/operators/throttleTime-spec.ts +++ b/spec/operators/throttleTime-spec.ts @@ -1,13 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -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 time: typeof marbleTestingSignature.time; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +declare function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/timeInterval-spec.ts b/spec/operators/timeInterval-spec.ts index 2c366582399..fc9de91cde4 100644 --- a/spec/operators/timeInterval-spec.ts +++ b/spec/operators/timeInterval-spec.ts @@ -1,11 +1,7 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/timeout-spec.ts b/spec/operators/timeout-spec.ts index 60e1c661072..085b4461212 100644 --- a/spec/operators/timeout-spec.ts +++ b/spec/operators/timeout-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; +declare function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; -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/timeoutWith-spec.ts b/spec/operators/timeoutWith-spec.ts index ee203b6e4aa..0eda1a1e1e3 100644 --- a/spec/operators/timeoutWith-spec.ts +++ b/spec/operators/timeoutWith-spec.ts @@ -1,12 +1,8 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -declare const { asDiagram }; +declare function asDiagram(arg: string): Function; declare const rxTestScheduler: Rx.TestScheduler; -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/timestamp-spec.ts b/spec/operators/timestamp-spec.ts index b324546dae3..34a09f15458 100644 --- a/spec/operators/timestamp-spec.ts +++ b/spec/operators/timestamp-spec.ts @@ -1,153 +1,149 @@ -import * as Rx from '../../src/Rx'; -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; - -/** @test {timestamp} */ -describe('Observable.prototype.timestamp', () => { - asDiagram('timestamp')('should record the time stamp per each source elements', () => { - const e1 = hot('-b-c-----d--e--|'); - const e1subs = '^ !'; - const expected = '-w-x-----y--z--|'; - const expectedValue = { w: 10, x: 30, y: 90, z: 120 }; - - const result = e1.timestamp(rxTestScheduler) - .map(x => x.timestamp); - - expectObservable(result).toBe(expected, expectedValue); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should record stamp if source emit elements', () => { - const e1 = hot('--a--^b--c----d---e--|'); - const e1subs = '^ !'; - const expected = '-w--x----y---z--|'; - - const expectedValue = { - w: new Rx.Timestamp('b', 10), - x: new Rx.Timestamp('c', 40), - y: new Rx.Timestamp('d', 90), - z: new Rx.Timestamp('e', 130) - }; - - expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected, expectedValue); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should completes without record stamp if source does not emits', () => { - const e1 = hot('---------|'); - const e1subs = '^ !'; - const expected = '---------|'; - - expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should complete immediately if source is empty', () => { - const e1 = cold('|'); - const e1subs = '(^!)'; - const expected = '|'; - - expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should record stamp then does not completes if source emits but not completes', () => { - const e1 = hot('-a--b--'); - const e1subs = '^ '; - const expected = '-y--z--'; - - const expectedValue = { - y: new Rx.Timestamp('a', 10), - z: new Rx.Timestamp('b', 40) - }; - - expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected, expectedValue); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should allow unsubscribing explicitly and early', () => { - const e1 = hot('-a--b-----c---d---|'); - const unsub = ' ! '; - const e1subs = '^ ! '; - const expected = '-y--z--- '; - - const expectedValue = { - y: new Rx.Timestamp('a', 10), - z: new Rx.Timestamp('b', 40) - }; - - const result = e1.timestamp(rxTestScheduler); - - expectObservable(result, unsub).toBe(expected, expectedValue); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should not break unsubscription chains when result is unsubscribed explicitly', () => { - const e1 = hot('-a--b-----c---d---|'); - const e1subs = '^ ! '; - const expected = '-y--z--- '; - const unsub = ' ! '; - - const expectedValue = { - y: new Rx.Timestamp('a', 10), - z: new Rx.Timestamp('b', 40) - }; - - const result = e1 - .mergeMap(x => Observable.of(x)) - .timestamp(rxTestScheduler) - .mergeMap(x => Observable.of(x)); - - expectObservable(result, unsub).toBe(expected, expectedValue); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should not completes if source never completes', () => { - const e1 = cold('-'); - const e1subs = '^'; - const expected = '-'; - - expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('raise error if source raises error', () => { - const e1 = hot('---#'); - const e1subs = '^ !'; - const expected = '---#'; - - expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should record stamp then raise error if source raises error after emit', () => { - const e1 = hot('-a--b--#'); - const e1subs = '^ !'; - const expected = '-y--z--#'; - - const expectedValue = { - y: new Rx.Timestamp('a', 10), - z: new Rx.Timestamp('b', 40) - }; - - expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected, expectedValue); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); - - it('should raise error if source immediately throws', () => { - const e1 = cold('#'); - const e1subs = '(^!)'; - const expected = '#'; - - expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected); - expectSubscriptions(e1.subscriptions).toBe(e1subs); - }); +import * as Rx from '../../src/Rx'; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +declare function asDiagram(arg: string): Function; + +declare const rxTestScheduler: Rx.TestScheduler; +const Observable = Rx.Observable; + +/** @test {timestamp} */ +describe('Observable.prototype.timestamp', () => { + asDiagram('timestamp')('should record the time stamp per each source elements', () => { + const e1 = hot('-b-c-----d--e--|'); + const e1subs = '^ !'; + const expected = '-w-x-----y--z--|'; + const expectedValue = { w: 10, x: 30, y: 90, z: 120 }; + + const result = e1.timestamp(rxTestScheduler) + .map(x => x.timestamp); + + expectObservable(result).toBe(expected, expectedValue); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should record stamp if source emit elements', () => { + const e1 = hot('--a--^b--c----d---e--|'); + const e1subs = '^ !'; + const expected = '-w--x----y---z--|'; + + const expectedValue = { + w: new Rx.Timestamp('b', 10), + x: new Rx.Timestamp('c', 40), + y: new Rx.Timestamp('d', 90), + z: new Rx.Timestamp('e', 130) + }; + + expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected, expectedValue); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should completes without record stamp if source does not emits', () => { + const e1 = hot('---------|'); + const e1subs = '^ !'; + const expected = '---------|'; + + expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should complete immediately if source is empty', () => { + const e1 = cold('|'); + const e1subs = '(^!)'; + const expected = '|'; + + expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should record stamp then does not completes if source emits but not completes', () => { + const e1 = hot('-a--b--'); + const e1subs = '^ '; + const expected = '-y--z--'; + + const expectedValue = { + y: new Rx.Timestamp('a', 10), + z: new Rx.Timestamp('b', 40) + }; + + expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected, expectedValue); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should allow unsubscribing explicitly and early', () => { + const e1 = hot('-a--b-----c---d---|'); + const unsub = ' ! '; + const e1subs = '^ ! '; + const expected = '-y--z--- '; + + const expectedValue = { + y: new Rx.Timestamp('a', 10), + z: new Rx.Timestamp('b', 40) + }; + + const result = e1.timestamp(rxTestScheduler); + + expectObservable(result, unsub).toBe(expected, expectedValue); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should not break unsubscription chains when result is unsubscribed explicitly', () => { + const e1 = hot('-a--b-----c---d---|'); + const e1subs = '^ ! '; + const expected = '-y--z--- '; + const unsub = ' ! '; + + const expectedValue = { + y: new Rx.Timestamp('a', 10), + z: new Rx.Timestamp('b', 40) + }; + + const result = e1 + .mergeMap(x => Observable.of(x)) + .timestamp(rxTestScheduler) + .mergeMap(x => Observable.of(x)); + + expectObservable(result, unsub).toBe(expected, expectedValue); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should not completes if source never completes', () => { + const e1 = cold('-'); + const e1subs = '^'; + const expected = '-'; + + expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('raise error if source raises error', () => { + const e1 = hot('---#'); + const e1subs = '^ !'; + const expected = '---#'; + + expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should record stamp then raise error if source raises error after emit', () => { + const e1 = hot('-a--b--#'); + const e1subs = '^ !'; + const expected = '-y--z--#'; + + const expectedValue = { + y: new Rx.Timestamp('a', 10), + z: new Rx.Timestamp('b', 40) + }; + + expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected, expectedValue); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); + + it('should raise error if source immediately throws', () => { + const e1 = cold('#'); + const e1subs = '(^!)'; + const expected = '#'; + + expectObservable(e1.timestamp(rxTestScheduler)).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); }); \ No newline at end of file diff --git a/spec/operators/toArray-spec.ts b/spec/operators/toArray-spec.ts index 0b91e794967..c6020cd1b67 100644 --- a/spec/operators/toArray-spec.ts +++ b/spec/operators/toArray-spec.ts @@ -1,11 +1,8 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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; +declare const type: Function; +declare const asDiagram: Function; const Observable = Rx.Observable; diff --git a/spec/operators/window-spec.ts b/spec/operators/window-spec.ts index 312c96c8544..cca46213cc6 100644 --- a/spec/operators/window-spec.ts +++ b/spec/operators/window-spec.ts @@ -1,11 +1,8 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 type: Function; +declare const asDiagram: Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/windowCount-spec.ts b/spec/operators/windowCount-spec.ts index 8691759b824..0b158a61237 100644 --- a/spec/operators/windowCount-spec.ts +++ b/spec/operators/windowCount-spec.ts @@ -1,11 +1,8 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 type: Function; +declare const asDiagram: Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/windowTime-spec.ts b/spec/operators/windowTime-spec.ts index d632a65de0b..59bd6af7987 100644 --- a/spec/operators/windowTime-spec.ts +++ b/spec/operators/windowTime-spec.ts @@ -1,12 +1,8 @@ import * as Rx from '../../src/Rx'; -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; +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; + +declare const type: Function; +declare const asDiagram: Function; const Observable = Rx.Observable; /** @test {windowTime} */ diff --git a/spec/operators/windowToggle-spec.ts b/spec/operators/windowToggle-spec.ts index 7184a0e2b40..b6551653699 100644 --- a/spec/operators/windowToggle-spec.ts +++ b/spec/operators/windowToggle-spec.ts @@ -1,12 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 type: Function; +declare const asDiagram: Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/windowWhen-spec.ts b/spec/operators/windowWhen-spec.ts index 5e6f0832d94..ec3a258ea5f 100644 --- a/spec/operators/windowWhen-spec.ts +++ b/spec/operators/windowWhen-spec.ts @@ -1,11 +1,8 @@ import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 type: Function; +declare const asDiagram: Function; declare const rxTestScheduler: Rx.TestScheduler; const Observable = Rx.Observable; diff --git a/spec/operators/withLatestFrom-spec.ts b/spec/operators/withLatestFrom-spec.ts index 7e98d5cc448..61fbed4b81a 100644 --- a/spec/operators/withLatestFrom-spec.ts +++ b/spec/operators/withLatestFrom-spec.ts @@ -1,13 +1,9 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; import { lowerCaseO } from '../helpers/test-helper'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; const Observable = Rx.Observable; diff --git a/spec/operators/zip-spec.ts b/spec/operators/zip-spec.ts index c6d779afa57..466e86fa843 100644 --- a/spec/operators/zip-spec.ts +++ b/spec/operators/zip-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; 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; const Observable = Rx.Observable; diff --git a/spec/operators/zipAll-spec.ts b/spec/operators/zipAll-spec.ts index 468ae62885d..a7d1ab4eeb4 100644 --- a/spec/operators/zipAll-spec.ts +++ b/spec/operators/zipAll-spec.ts @@ -1,12 +1,8 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports +import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; -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 function asDiagram(arg: string): Function; declare const Symbol: any; const Observable = Rx.Observable; diff --git a/spec/schedulers/TestScheduler-spec.ts b/spec/schedulers/TestScheduler-spec.ts index 9ee546324f4..387737f6a60 100644 --- a/spec/schedulers/TestScheduler-spec.ts +++ b/spec/schedulers/TestScheduler-spec.ts @@ -1,12 +1,6 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -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; +import { hot, cold, expectObservable, expectSubscriptions, time } from '../helpers/marble-testing'; declare const rxTestScheduler: Rx.TestScheduler; const Notification = Rx.Notification; diff --git a/spec/subjects/BehaviorSubject-spec.ts b/spec/subjects/BehaviorSubject-spec.ts index 638569d17ba..0003d009ee0 100644 --- a/spec/subjects/BehaviorSubject-spec.ts +++ b/spec/subjects/BehaviorSubject-spec.ts @@ -1,10 +1,6 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; -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; +import { hot, expectObservable } from '../helpers/marble-testing'; const BehaviorSubject = Rx.BehaviorSubject; const Observable = Rx.Observable; diff --git a/spec/subjects/ReplaySubject-spec.ts b/spec/subjects/ReplaySubject-spec.ts index c86f4ae70f9..fd58be84574 100644 --- a/spec/subjects/ReplaySubject-spec.ts +++ b/spec/subjects/ReplaySubject-spec.ts @@ -1,10 +1,7 @@ import { expect } from 'chai'; import * as Rx from '../../src/Rx'; import { TestScheduler } from '../../src/internal/testing/TestScheduler'; -import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports - -declare const hot: typeof marbleTestingSignature.hot; -declare const expectObservable: typeof marbleTestingSignature.expectObservable; +import { hot, expectObservable } from '../helpers/marble-testing'; declare const rxTestScheduler: TestScheduler; diff --git a/spec/tsconfig.json b/spec/tsconfig.json new file mode 100644 index 00000000000..b647c7faeb5 --- /dev/null +++ b/spec/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noImplicitAny": false + } +} \ No newline at end of file