forked from ReactiveX/rxjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(mergeWith): add mergeWith * test(mergeWith): update tests
- Loading branch information
Showing
9 changed files
with
503 additions
and
389 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { mergeWith } from 'rxjs/operators'; | ||
import { a$, b$, c$, d$, e$, f$, g$, h$} from '../helpers'; | ||
|
||
it('should accept N args', () => { | ||
const r0 = a$.pipe(mergeWith()); // $ExpectType Observable<A> | ||
const r1 = a$.pipe(mergeWith(b$)); // $ExpectType Observable<A | B> | ||
const r2 = a$.pipe(mergeWith(b$, c$)); // $ExpectType Observable<A | B | C> | ||
const r3 = a$.pipe(mergeWith(b$, c$, d$)); // $ExpectType Observable<A | B | C | D> | ||
const r4 = a$.pipe(mergeWith(b$, c$, d$, e$)); // $ExpectType Observable<A | B | C | D | E> | ||
const r5 = a$.pipe(mergeWith(b$, c$, d$, e$, f$)); // $ExpectType Observable<A | B | C | D | E | F> | ||
const r6 = a$.pipe(mergeWith(b$, c$, d$, e$, f$, g$)); // $ExpectType Observable<A | B | C | D | E | F | G> | ||
const r7 = a$.pipe(mergeWith(b$, c$, d$, e$, f$, g$, h$)); // $ExpectType Observable<A | B | C | D | E | F | G | H> | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { merge } from 'rxjs/operators'; | ||
import { queueScheduler, of } from 'rxjs'; | ||
import { expect } from 'chai'; | ||
|
||
describe('merge (legacy)', () => { | ||
it('should merge an immediately-scheduled source with an immediately-scheduled second', done => { | ||
const a = of(1, 2, 3, queueScheduler); | ||
const b = of(4, 5, 6, 7, 8, queueScheduler); | ||
const r = [1, 2, 4, 3, 5, 6, 7, 8]; | ||
|
||
a.pipe(merge(b, queueScheduler)).subscribe( | ||
val => { | ||
expect(val).to.equal(r.shift()); | ||
}, | ||
x => { | ||
done(new Error('should not be called')); | ||
}, | ||
() => { | ||
done(); | ||
} | ||
); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.