mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
Add jest test to ensure consistency between AnimatedMock and AnimatedImplementation
Summary: Flow doesn't guarantee that AnimatedMock and AnimatedImplementation won't diverge. Christoph suggested a quick jest test in D13811035 Reviewed By: cpojer Differential Revision: D13953915 fbshipit-source-id: ba5aeafded429113cc60a6250b5b29d2f8c8ab28
This commit is contained in:
committed by
Facebook Github Bot
parent
833429dd63
commit
8a5614b283
29
Libraries/Animated/src/__tests__/AnimatedMock-test.js
Normal file
29
Libraries/Animated/src/__tests__/AnimatedMock-test.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @format
|
||||
* @emails oncall+react_native
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const AnimatedMock = require('AnimatedMock');
|
||||
const AnimatedImplementation = require('AnimatedImplementation');
|
||||
|
||||
describe('Animated Mock', () => {
|
||||
it('matches implementation keys', () => {
|
||||
expect(Object.keys(AnimatedMock)).toEqual(
|
||||
Object.keys(AnimatedImplementation),
|
||||
);
|
||||
});
|
||||
it('matches implementation params', () => {
|
||||
Object.keys(AnimatedImplementation).forEach(key =>
|
||||
expect(AnimatedImplementation[key].length).toEqual(
|
||||
AnimatedMock[key].length,
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user