Skip to content

Commit

Permalink
fix: mock.js NOOP to allow for "new" constructor call (#439)
Browse files Browse the repository at this point in the history
i'm getting errors in my tests from this mock as the new Value(0) call throws for arrow functions, this seems to work when i updated my mock.js in node_modules.
  • Loading branch information
ajsmth authored and osdnk committed Oct 31, 2019
1 parent 2a46f32 commit baf4fac
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mock.js
Expand Up @@ -11,7 +11,7 @@
const React = require('react');
const { View, Text, Image, Animated } = require('react-native');

const NOOP = () => undefined;
function NOOP() {}

class Code extends React.Component {
render() {
Expand All @@ -37,7 +37,11 @@ module.exports = {

Clock: NOOP,
Node: NOOP,
Value: NOOP,
Value: function() {
return {
setValue: NOOP,
};
},

Extrapolate: {
EXTEND: 'extend',
Expand Down Expand Up @@ -97,6 +101,8 @@ module.exports = {
timing: NOOP,
spring: NOOP,

proc: () => NOOP,

useCode: NOOP,
createAnimatedComponent: Component => Component,
},
Expand Down

0 comments on commit baf4fac

Please sign in to comment.