fix(core): use presence of .subscribe to detect observables rather then Symbol.observable (#15171)
Fixes #14298 Fixes #14473 Fixes #14926
This commit is contained in:

committed by
Chuck Jazdzewski

parent
313158132d
commit
6e98757665
@ -30,6 +30,9 @@ export function main() {
|
||||
describe('isObservable', () => {
|
||||
it('should be true for an Observable', () => expect(isObservable(of (true))).toEqual(true));
|
||||
|
||||
it('should be true if the argument is the object with subscribe function',
|
||||
() => expect(isObservable({subscribe: () => {}})).toEqual(true));
|
||||
|
||||
it('should be false if the argument is undefined',
|
||||
() => expect(isObservable(undefined)).toEqual(false));
|
||||
|
||||
@ -40,8 +43,5 @@ export function main() {
|
||||
|
||||
it('should be false if the argument is a function',
|
||||
() => expect(isObservable(() => {})).toEqual(false));
|
||||
|
||||
it('should be false if the argument is the object with subscribe function',
|
||||
() => expect(isObservable({subscribe: () => {}})).toEqual(false));
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user