Files
react-native/Libraries/Animated/src/Animated.js
T
Peter Argany 45686c86e2 Mock Animated for testing
Summary:
Animated views can cause flakiness in snapshot tests. This mock replaces all provided Animated transforms with a blank animation.

This could potentially break some tests which animate in elements and then verify their existence. I can deal with that fallout in follow up diffs. One option is making all animations take 0 seconds when testing.

Reviewed By: cpojer

Differential Revision: D13811035

fbshipit-source-id: cc6b13c7d6bad29b125d35ef759a269bb0372e67
2019-02-04 18:33:52 -08:00

40 lines
803 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';
import Platform from 'Platform';
const AnimatedImplementation = Platform.isTesting
? require('AnimatedMock')
: require('AnimatedImplementation');
module.exports = {
get FlatList() {
return require('AnimatedFlatList');
},
get Image() {
return require('AnimatedImage');
},
get ScrollView() {
return require('AnimatedScrollView');
},
get SectionList() {
return require('AnimatedSectionList');
},
get Text() {
return require('AnimatedText');
},
get View() {
return require('AnimatedView');
},
...AnimatedImplementation,
};