From 4654b34c971a9b30eca902f9ffe893effb40edf4 Mon Sep 17 00:00:00 2001 From: Martin Konicek Date: Wed, 2 Mar 2016 05:45:50 -0800 Subject: [PATCH] Revert Remove invariant hack for jest Summary: This reverts D2988899 as it consistently broke the Invariant test on Travis: https://travis-ci.org/facebook/react-native Reviewed By: bestander Differential Revision: D2999915 fb-gh-sync-id: 781ab5f6fc8e3b97bc4d215af855823f4b5014dd shipit-source-id: 781ab5f6fc8e3b97bc4d215af855823f4b5014dd --- Libraries/Animated/src/Interpolation.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Libraries/Animated/src/Interpolation.js b/Libraries/Animated/src/Interpolation.js index c8daa2406..b97d063b9 100644 --- a/Libraries/Animated/src/Interpolation.js +++ b/Libraries/Animated/src/Interpolation.js @@ -12,9 +12,17 @@ /* eslint no-bitwise: 0 */ 'use strict'; -var invariant = require('invariant'); var normalizeColor = require('normalizeColor'); +// TODO(#7644673): fix this hack once github jest actually checks invariants +var invariant = function(condition, message) { + if (!condition) { + var error = new Error(message); + (error: any).framesToPop = 1; // $FlowIssue + throw error; + } +}; + type ExtrapolateType = 'extend' | 'identity' | 'clamp'; export type InterpolationConfigType = {