Skip to content

Commit

Permalink
test(share): add test that verifies Promise support
Browse files Browse the repository at this point in the history
  • Loading branch information
jakovljevic-mladen committed Dec 15, 2022
1 parent 171abf0 commit 94dd6de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec-dtslint/operators/share-spec.ts
Expand Up @@ -8,3 +8,8 @@ it('should infer correctly', () => {
it('should enforce types', () => {
const o = of('foo', 'bar', 'baz').pipe(share('abc')); // $ExpectError
});

it('should support Promises', () => {
const factory = () => Promise.resolve();
of(1, 2, 3).pipe(share({ resetOnError: factory, resetOnComplete: factory, resetOnRefCountZero: factory })); // $ExpectType Observable<number>
});

0 comments on commit 94dd6de

Please sign in to comment.