MCPcopy Index your code
hub / github.com/nodejs/node / re

Function re

test/parallel/test-assert-deep.js:19–38  ·  view source on GitHub ↗
(literals, ...values)

Source from the content-addressed store, hash-verified

17// Template tag function turning an error message into a RegExp
18// for assert.throws()
19function 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
40const date = new Date('2016');
41

Callers 1

assertNotDeepOrStrictFunction · 0.70

Calls 2

inspectMethod · 0.80
entriesMethod · 0.45

Tested by

no test coverage detected