(name, fn)
| 90 | } |
| 91 | |
| 92 | async function test(name, fn) { |
| 93 | testResults.total++; |
| 94 | try { |
| 95 | await fn(); |
| 96 | testResults.passed++; |
| 97 | console.log(`%cPASS ${name}`, "color: green;"); |
| 98 | return true; |
| 99 | } catch (error) { |
| 100 | testResults.failed++; |
| 101 | console.error(`%cFAIL ${name}`, "color: red;", error); |
| 102 | return false; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | function section(name) { |
| 107 | console.log(`\n%c--- ${name} ---`, "color: orange; font-weight: bold;"); |
no test coverage detected