Skip to content

Commit

Permalink
fix(TestScheduler): helper methods return proper types, `HotObservabl…
Browse files Browse the repository at this point in the history
…e` and `ColdObservable` instead of Observable (#2305)

Return `HotObservable` and `ColdObservable` instead of simply `Observable`, in order to give users access to subscriptions parameter
  • Loading branch information
mpodlasin authored and benlesh committed Jan 29, 2017
1 parent 30a4ca4 commit 758aae9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/testing/TestScheduler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Observable } from '../Observable';
import { Notification } from '../Notification';
import { Subject } from '../Subject';
import { ColdObservable } from './ColdObservable';
import { HotObservable } from './HotObservable';
import { TestMessage } from './TestMessage';
Expand Down Expand Up @@ -36,7 +35,7 @@ export class TestScheduler extends VirtualTimeScheduler {
return indexOf * TestScheduler.frameTimeFactor;
}

createColdObservable<T>(marbles: string, values?: any, error?: any): Observable<T> {
createColdObservable<T>(marbles: string, values?: any, error?: any): ColdObservable<T> {
if (marbles.indexOf('^') !== -1) {
throw new Error('cold observable cannot have subscription offset "^"');
}
Expand All @@ -49,7 +48,7 @@ export class TestScheduler extends VirtualTimeScheduler {
return cold;
}

createHotObservable<T>(marbles: string, values?: any, error?: any): Subject<T> {
createHotObservable<T>(marbles: string, values?: any, error?: any): HotObservable<T> {
if (marbles.indexOf('!') !== -1) {
throw new Error('hot observable cannot have unsubscription marker "!"');
}
Expand Down

0 comments on commit 758aae9

Please sign in to comment.