/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/Libraries/Animated/__tests__/AnimatedProps-test.js
30 строк
882 B
Tim Yung
RN: Delete `@oncall` Annotations (#51416)
18 май 2025, 02:18
18 май 2025, 02:18
84de8a0
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict-local * @format */ import AnimatedProps from '../nodes/AnimatedProps'; describe('AnimatedProps', () => { function getValue(inputProps: {[string]: mixed}) { const animatedProps = new AnimatedProps(inputProps, jest.fn()); return animatedProps.__getValue(); } it('returns original `style` if it has no nodes', () => { const style = {color: 'red'}; expect(getValue({style}).style).toBe(style); }); it('returns original `style` for invalid style values', () => { const values = [undefined, null, function () {}, true, 123, 'foo']; for (const value of values) { expect(getValue({style: value})).toEqual({style: value}); } }); });