-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_react_tests.sh
More file actions
38 lines (37 loc) · 1.47 KB
/
Copy pathrun_react_tests.sh
File metadata and controls
38 lines (37 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
npx vitest run --reporter=./src/client/util/customJsonReporter.ts $@ | \
awk '/^\{/{f=1} f' | \
jq '{
tests: .numTotalTests,
passed: .numPassedTests,
failed: .numFailedTests,
results: [
# only files with at least one failure, or suite-level failures (e.g. module load errors)
(.testResults[] | select(.status == "failed")) | {
file: .name,
errors: .errors,
results: [
# only failed assertions within this file
(.assertionResults[] | select(.status == "failed")) | {
name: .fullName,
errors: .errors,
logs: [.logs[] | {type, content}]
}
]
}
],
noisyPasses: [
# only files with at least one passing test that produced logs
(.testResults[] | select(any(.assertionResults[]; .status == "passed" and (.logs | length > 0)))) | {
file: .name,
results: [
# only passing assertions that produced logs
(.assertionResults[] | select(.status == "passed" and (.logs | length > 0))) | {
name: .fullName,
logs: [.logs[] | {type, content}]
}
]
}
],
unassociatedLogs: [.unassociatedLogs[] | {type, content}]
}'