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:
Peter Argany
2019-02-06 10:52:06 -08:00
committed by Facebook Github Bot
parent 833429dd63
commit 8a5614b283

View 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,
),
);
});
});