* 格式化错误信息
()
| 20 | * 格式化错误信息 |
| 21 | */ |
| 22 | toString(): string { |
| 23 | let msg = `${this.name}: ${this.message}`; |
| 24 | |
| 25 | if (this.expected !== undefined) { |
| 26 | msg += `\n Expected: ${JSON.stringify(this.expected, null, 2)}`; |
| 27 | } |
| 28 | |
| 29 | if (this.actual !== undefined) { |
| 30 | msg += `\n Actual: ${JSON.stringify(this.actual, null, 2)}`; |
| 31 | } |
| 32 | |
| 33 | if (this.details !== undefined) { |
| 34 | msg += `\n Details: ${JSON.stringify(this.details, null, 2)}`; |
| 35 | } |
| 36 | |
| 37 | return msg; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | /** |
no outgoing calls
no test coverage detected