Skip to content

Commit

Permalink
chore(dtslint): add higher-order observable tests (#3958)
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant authored and benlesh committed Jul 27, 2018
1 parent e9baa94 commit 310b9f5
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec-dtslint/operators/concatAll-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { of } from 'rxjs';
import { concatAll } from 'rxjs/operators';

it('should infer correctly', () => {
const o = of(of(1, 2, 3)).pipe(concatAll()); // $ExpectType Observable<number>
});

it('should enforce types', () => {
const o = of(1, 2, 3).pipe(concatAll()); // $ExpectError
});
10 changes: 10 additions & 0 deletions spec-dtslint/operators/exhaust-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { of } from 'rxjs';
import { exhaust } from 'rxjs/operators';

it('should infer correctly', () => {
const o = of(of(1, 2, 3)).pipe(exhaust()); // $ExpectType Observable<number>
});

it('should enforce types', () => {
const o = of(1, 2, 3).pipe(exhaust()); // $ExpectError
});
10 changes: 10 additions & 0 deletions spec-dtslint/operators/mergeAll-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { of } from 'rxjs';
import { mergeAll } from 'rxjs/operators';

it('should infer correctly', () => {
const o = of(of(1, 2, 3)).pipe(mergeAll()); // $ExpectType Observable<number>
});

it('should enforce types', () => {
const o = of(1, 2, 3).pipe(mergeAll()); // $ExpectError
});
10 changes: 10 additions & 0 deletions spec-dtslint/operators/switchAll-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { of } from 'rxjs';
import { switchAll } from 'rxjs/operators';

it('should infer correctly', () => {
const o = of(of(1, 2, 3)).pipe(switchAll()); // $ExpectType Observable<number>
});

it('should enforce types', () => {
const o = of(1, 2, 3).pipe(switchAll()); // $ExpectError
});

0 comments on commit 310b9f5

Please sign in to comment.