mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
45686c86e2
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
40 lines
803 B
JavaScript
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,
|
|
};
|