When the regular expression exec() method finds a match, it returns an array containing first the entire matched portion of the string and then the portions of the string that matched each parenthesized group in the regular expression. Embedded hyperlinks in a thesis or research paper. Why are non-Western countries siding with China in the UN? The function I want to test is this one: componentDidMount () { this.fetchUser (); } And it is depended on this one: fetchUser = () => { getUser (this.getUserUsername ()).then (username => { this.setState ( { user: username.data }); }); }; I'm uncertain structure of res.data what is? How To Fix The Error "Cannot destructure Property of Undefined" In I know it is related to my compile.js file, but what is unusual is that my tests compiled just fine until I tried to update the solidity compiler version. Do new devs get fired if they can't solve a certain bug? jQuery document.createElement equivalent? const { item } = undefined or null // Uncaught TypeError: Cannot destructure property 'item' of 'null' as it is null. You can also use the nullish coalescing (??) Solution 2: