Lines Matching refs:assert
2 const assert = require('assert');
30 assert.strictEqual(end, report.length - 1);
74 assert(Object.hasOwn(report, section));
75 assert(typeof report[section] === 'object' && report[section] !== null);
82 assert.strictEqual(actual, expect);
84 assert(actual);
108 assert.strictEqual(header.reportVersion, 3); // Increment as needed.
109 assert.strictEqual(typeof header.event, 'string');
110 assert.strictEqual(typeof header.trigger, 'string');
111 assert(typeof header.filename === 'string' || header.filename === null);
112 assert.notStrictEqual(new Date(header.dumpEventTime).toString(),
114 assert(String(+header.dumpEventTimeStamp), header.dumpEventTimeStamp);
115 assert(Number.isSafeInteger(header.processId));
116 assert(Number.isSafeInteger(header.threadId) || header.threadId === null);
117 assert.strictEqual(typeof header.cwd, 'string');
118 assert(Array.isArray(header.commandLine));
120 assert.strictEqual(typeof arg, 'string');
122 assert.strictEqual(header.nodejsVersion, process.version);
123 assert(Number.isSafeInteger(header.wordSize));
124 assert.strictEqual(header.arch, os.arch());
125 assert.strictEqual(header.platform, os.platform());
126 assert.deepStrictEqual(header.componentVersions, process.versions);
127 assert.deepStrictEqual(header.release, process.release);
128 assert.strictEqual(header.osName, os.type());
129 assert.strictEqual(header.osRelease, os.release());
130 assert.strictEqual(typeof header.osVersion, 'string');
131 assert.strictEqual(typeof header.osMachine, 'string');
132 assert(Array.isArray(header.cpus));
133 assert.strictEqual(header.cpus.length, cpus.length);
135 assert.strictEqual(typeof cpu.model, 'string');
136 assert.strictEqual(typeof cpu.speed, 'number');
137 assert.strictEqual(typeof cpu.user, 'number');
138 assert.strictEqual(typeof cpu.nice, 'number');
139 assert.strictEqual(typeof cpu.sys, 'number');
140 assert.strictEqual(typeof cpu.idle, 'number');
141 assert.strictEqual(typeof cpu.irq, 'number');
142 assert(cpus.some((c) => {
147 assert(Array.isArray(header.networkInterfaces));
149 assert.strictEqual(typeof iface.name, 'string');
150 assert.strictEqual(typeof iface.internal, 'boolean');
151 assert.match(iface.mac, /^([0-9A-F][0-9A-F]:){5}[0-9A-F]{2}$/i);
154 assert.strictEqual(net.isIPv4(iface.address), true);
155 assert.strictEqual(net.isIPv4(iface.netmask), true);
156 assert.strictEqual(iface.scopeid, undefined);
158 assert.strictEqual(net.isIPv6(iface.address), true);
159 assert.strictEqual(net.isIPv6(iface.netmask), true);
160 assert(Number.isInteger(iface.scopeid));
162 assert.strictEqual(iface.family, 'unknown');
163 assert.strictEqual(iface.address, undefined);
164 assert.strictEqual(iface.netmask, undefined);
165 assert.strictEqual(iface.scopeid, undefined);
168 assert.strictEqual(header.host, os.hostname());
171 assert(Array.isArray(report.nativeStack));
173 assert(typeof frame === 'object' && frame !== null);
175 assert.strictEqual(typeof frame.pc, 'string');
176 assert.match(frame.pc, /^0x[0-9a-f]+$/);
177 assert.strictEqual(typeof frame.symbol, 'string');
184 assert.strictEqual(typeof report.javascriptStack.errorProperties,
186 assert.strictEqual(typeof report.javascriptStack.message, 'string');
188 assert(Array.isArray(report.javascriptStack.stack));
190 assert.strictEqual(typeof frame, 'string');
217 assert(
222 assert(typeof heap.heapSpaces === 'object' && heap.heapSpaces !== null);
229 assert(Number.isSafeInteger(space[field]));
244 assert.strictEqual(typeof usage.userCpuSeconds, 'number');
245 assert.strictEqual(typeof usage.kernelCpuSeconds, 'number');
246 assert.strictEqual(typeof usage.cpuConsumptionPercent, 'number');
247 assert.strictEqual(typeof usage.userCpuConsumptionPercent, 'number');
248 assert.strictEqual(typeof usage.kernelCpuConsumptionPercent, 'number');
249 assert(typeof usage.rss, 'string');
250 assert(typeof usage.maxRss, 'string');
251 assert(typeof usage.free_memory, 'string');
252 assert(typeof usage.total_memory, 'string');
253 assert(typeof usage.available_memory, 'string');
256 assert(typeof report.resourceUsage.constrained_memory, 'string');
258 assert(typeof usage.pageFaults === 'object' && usage.pageFaults !== null);
260 assert(Number.isSafeInteger(usage.pageFaults.IORequired));
261 assert(Number.isSafeInteger(usage.pageFaults.IONotRequired));
262 assert(typeof usage.fsActivity === 'object' && usage.fsActivity !== null);
264 assert(Number.isSafeInteger(usage.fsActivity.reads));
265 assert(Number.isSafeInteger(usage.fsActivity.writes));
275 assert.strictEqual(typeof usage.userCpuSeconds, 'number');
276 assert.strictEqual(typeof usage.kernelCpuSeconds, 'number');
277 assert.strictEqual(typeof usage.cpuConsumptionPercent, 'number');
278 assert.strictEqual(typeof usage.userCpuConsumptionPercent, 'number');
279 assert.strictEqual(typeof usage.kernelCpuConsumptionPercent, 'number');
280 assert(typeof usage.fsActivity === 'object' && usage.fsActivity !== null);
282 assert(Number.isSafeInteger(usage.fsActivity.reads));
283 assert(Number.isSafeInteger(usage.fsActivity.writes));
287 assert(Array.isArray(report.libuv));
289 assert.strictEqual(typeof resource.type, 'string');
290 assert.strictEqual(typeof resource.address, 'string');
291 assert.match(resource.address, /^0x[0-9a-f]+$/);
292 assert.strictEqual(typeof resource.is_active, 'boolean');
293 assert.strictEqual(typeof resource.is_referenced,
299 assert.strictEqual(typeof key, 'string');
300 assert.strictEqual(typeof value, 'string');
312 assert.strictEqual(typeof type, 'string');
313 assert(typeof limits === 'object' && limits !== null);
315 assert(typeof limits.soft === 'number' || limits.soft === 'unlimited',
317 assert(typeof limits.hard === 'number' || limits.hard === 'unlimited',
323 assert(Array.isArray(report.sharedObjects));
325 assert.strictEqual(typeof sharedObject, 'string');
329 assert(Array.isArray(report.workers));
335 assert(expected.includes(field), `'${field}' not expected in ${expected}`);