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 Oct 21, 2022
1 parent 3ae86f9 commit 3c4cb3c
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 3c4cb3c

Please sign in to comment.