Skip to content

Commit

Permalink
test: add empty-sources-array test for zip (#5999)
Browse files Browse the repository at this point in the history
* chore: correct a test description

* test: add an empty-source-array test for zip
  • Loading branch information
cartant authored Feb 8, 2021
1 parent d783cd1 commit 4fb5d7d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/observables/forkJoin-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ describe('forkJoin', () => {
});
});

it('should accept array of observables', () => {
it('should accept an object of observables', () => {
rxTestScheduler.run(({ hot, expectObservable }) => {
const e1 = forkJoin({
foo: hot(' --a--b--c--d--|'),
Expand Down
16 changes: 15 additions & 1 deletion spec/observables/zip-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,5 +541,19 @@ describe('static zip', () => {
['c','3','z'],
'complete'
]);
})
});

it('should return EMPTY if passed an empty array as the only argument', () => {
const results: string[] = [];
zip([]).subscribe({
next: () => {
throw new Error('should not emit')
},
complete: () => {
results.push('done');
}
});

expect(results).to.deep.equal(['done']);
});
});

0 comments on commit 4fb5d7d

Please sign in to comment.