Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(dtslint): add mergeMapTo #4097

Merged
merged 2 commits into from
Sep 11, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test(dtslint): add extra checks to mergeMapTo
timdeschryver committed Sep 5, 2018
commit 6b0abb822108ce5780d13b7f1d57c44a8f394846
9 changes: 9 additions & 0 deletions spec-dtslint/operators/mergeMapTo-spec.ts
Original file line number Diff line number Diff line change
@@ -9,6 +9,14 @@ it('should infer correctly multiple types', () => {
const o = of(1, 2, 3).pipe(mergeMapTo(of('foo', 4))); // $ExpectType Observable<string | number>
});

it('should infer correctly with an array', () => {
const o = of(1, 2, 3).pipe(mergeMapTo([4, 5, 6])); // $ExpectType Observable<number>
});

it('should infer correctly with a Promise', () => {
const o = of(1, 2, 3).pipe(mergeMapTo(new Promise<string>(() => {}))); // $ExpectType Observable<string>
});

it('should support a concurrent parameter', () => {
const o = of(1, 2, 3).pipe(mergeMapTo(of('foo'), 4)); // $ExpectType Observable<string>
});
@@ -39,6 +47,7 @@ it('should enforce types', () => {

it('should enforce the return type', () => {
const o = of(1, 2, 3).pipe(mergeMapTo(p => p)); // $ExpectError
const p = of(1, 2, 3).pipe(mergeMapTo(4)); // $ExpectError
});

it('should enforce types of the concurrent parameter', () => {