Skip to content

Commit 5891166

Browse files
committed
feat(transform_conformance): custom reporter for exec test (#7715)
closes #7704
1 parent 9257d9d commit 5891166

File tree

3 files changed

+40
-350
lines changed

3 files changed

+40
-350
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { JsonReporter } from 'vitest/reporters';
2+
3+
export default class CustomReporter extends JsonReporter {
4+
async writeReport(report) {
5+
const json = JSON.parse(report);
6+
console.log();
7+
for (const testResult of json.testResults) {
8+
if (testResult.status !== 'failed') {
9+
continue;
10+
}
11+
const message = testResult.message;
12+
if (!message) {
13+
continue;
14+
}
15+
const name = testResult.name.replace(import.meta.dirname, '.');
16+
console.log(name);
17+
console.log(message);
18+
console.log();
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)