| 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('; '); |