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

Method fail

test/common/wpt.js:975–1003  ·  view source on GitHub ↗
(spec, test, status, reportResult)

Source from the content-addressed store, hash-verified

973 }
974
975 fail(spec, test, status, reportResult) {
976 const expected = spec.failedTests.includes(test.name);
977 if (expected) {
978 console.log(`[EXPECTED_FAILURE][${status.toUpperCase()}] ${test.name}`);
979 } else {
980 console.log(`[UNEXPECTED_FAILURE][${status.toUpperCase()}] ${test.name}`);
981 }
982 if (status === kFail || status === kUncaught) {
983 console.log(test.message);
984 console.log(test.stack);
985 }
986 const command = `${process.execPath} ${process.execArgv}` +
987 ` ${require.main?.filename} '${spec.filename}${spec.variant}'`;
988 console.log(`Command: ${command}\n`);
989
990 reportResult?.addSubtest(test.name, 'FAIL', test.message);
991 if (expected) {
992 this.subtestCounts.expectedFailures++;
993 } else {
994 this.subtestCounts.failed++;
995 }
996
997 this.addTestResult(spec, {
998 name: test.name,
999 expected,
1000 status: kFail,
1001 reason: test.message || status,
1002 });
1003 }
1004
1005 skip(spec, reasons) {
1006 const joinedReasons = reasons.join('; ');

Callers 15

runJsTestsMethod · 0.95
resultCallbackMethod · 0.95
completionCallbackMethod · 0.95
mainFunction · 0.45
mainFunction · 0.45
cbFunction · 0.45
cbFunction · 0.45
cbFunction · 0.45
mainFunction · 0.45
handleRequestFunction · 0.45
handleRequestFunction · 0.45

Calls 4

addTestResultMethod · 0.95
includesMethod · 0.80
addSubtestMethod · 0.80
logMethod · 0.45

Tested by 4

testFunction · 0.36
testFunction · 0.36
testFunction · 0.36
testFunction · 0.36