(literals, ...values)
| 17 | // Template tag function turning an error message into a RegExp |
| 18 | // for assert.throws() |
| 19 | function re(literals, ...values) { |
| 20 | let result = 'Expected values to be loosely deep-equal:\n\n'; |
| 21 | for (const [i, value] of values.entries()) { |
| 22 | const str = util.inspect(value, { |
| 23 | compact: false, |
| 24 | depth: 1000, |
| 25 | customInspect: false, |
| 26 | maxArrayLength: Infinity, |
| 27 | breakLength: Infinity, |
| 28 | sorted: true, |
| 29 | getters: true |
| 30 | }); |
| 31 | // Need to escape special characters. |
| 32 | result += `${str}${literals[i + 1]}`; |
| 33 | } |
| 34 | return { |
| 35 | code: 'ERR_ASSERTION', |
| 36 | message: result |
| 37 | }; |
| 38 | } |
| 39 | |
| 40 | const date = new Date('2016'); |
| 41 |
no test coverage detected