upgrade-support
upgrade-support copied to clipboard
RangeError: Invalid string length
Since upgrading the RN from 0.75.4 to 0.77.0 I'm encountering snapshots fails when I run these kind of tests.
it('ExampleTest - default', () => { const tree = render( <ThemeProvider> <ExampleTest /> </ThemeProvider> ).toJSON();
expect(tree).toMatchSnapshot();
});
44 | ).toJSON();
45 |
> 46 | expect(tree).toMatchSnapshot();
| ^
47 | });
at printObjectProperties (node_modules/pretty-format/build/collections.js:170:47) at key (node_modules/pretty-format/build/index.js:386:38) at AsymmetricMatcher (node_modules/pretty-format/build/index.js:469:3) at printObjectProperties (node_modules/pretty-format/build/collections.js:169:21) at key (node_modules/pretty-format/build/index.js:386:38) at AsymmetricMatcher (node_modules/pretty-format/build/index.js:469:3) at printObjectProperties (node_modules/pretty-format/build/collections.js:169:21) at key (node_modules/pretty-format/build/index.js:386:38) at AsymmetricMatcher (node_modules/pretty-format/build/index.js:469:3) at printObjectProperties (node_modules/pretty-format/build/collections.js:169:21) at key (node_modules/pretty-format/build/index.js:386:38) at AsymmetricMatcher (node_modules/pretty-format/build/index.js:469:3) at printObjectProperties (node_modules/pretty-format/build/collections.js:169:21) at key (node_modules/pretty-format/build/index.js:386:38)
Facing the same problem. Did you get it working?
In my case, it seems to be related to react-native-reanimated version 3.16.0
It seems it was created by excluding the mock files needed in Jest: https://github.com/facebook/react-native/pull/51530
I have no work-around yet.