(str)
| 33 | const shouldIgnoreConsoleError = require('./shouldIgnoreConsoleError') |
| 34 | |
| 35 | function normalizeCodeLocInfo(str) { |
| 36 | if (typeof str !== 'string') { |
| 37 | return str |
| 38 | } |
| 39 | // This special case exists only for the special source location in |
| 40 | // ReactElementValidator. That will go away if we remove source locations. |
| 41 | str = str.replace(/Check your code at .+?:\d+/g, 'Check your code at **') |
| 42 | // V8 format: |
| 43 | // at Component (/path/filename.js:123:45) |
| 44 | // React format: |
| 45 | // in Component (at filename.js:123) |
| 46 | // eslint-disable-next-line prefer-arrow-callback |
| 47 | return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) { |
| 48 | return '\n in ' + name + ' (at **)' |
| 49 | }) |
| 50 | } |
| 51 | |
| 52 | const createMatcherFor = (consoleMethod, matcherName) => |
| 53 | function matcher(callback, expectedMessages, options = {}) { |
no outgoing calls
no test coverage detected
searching dependent graphs…