/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/core/test/util/lang_spec.ts
27 строк
1005 B
Andrew Kushnir
refactor(core): convert scripts within `packages/core/test` to relative imports (#60227)
25 мар 2025, 20:58
25 мар 2025, 20:58
ae047c5
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {isSubscribable} from '../../src/util/lang'; import {of} from 'rxjs'; describe('isSubscribable', () => { it('should be true for an Observable', () => expect(isSubscribable(of(true))).toEqual(true)); it('should be true if the argument is the object with subscribe function', () => expect(isSubscribable({subscribe: () => {}})).toEqual(true)); it('should be false if the argument is undefined', () => expect(isSubscribable(undefined)).toEqual(false)); it('should be false if the argument is null', () => expect(isSubscribable(null)).toEqual(false)); it('should be false if the argument is an object', () => expect(isSubscribable({})).toEqual(false)); it('should be false if the argument is a function', () => expect(isSubscribable(() => {})).toEqual(false)); });