diff --git a/scripts/jest/setupTests.js b/scripts/jest/setupTests.js index b1842d15a7228..d796d8e101d18 100644 --- a/scripts/jest/setupTests.js +++ b/scripts/jest/setupTests.js @@ -70,6 +70,9 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) { .map(s => s.substr('args[]='.length)) .map(decodeURIComponent); const format = errorMap[code]; + if (!format) { + return message; + } let argIndex = 0; return format.replace(/%s/g, () => args[argIndex++]); };