( actual: T, expected: T, msg?: string, )
| 22 | * @param msg The optional message to display if the assertion fails. |
| 23 | */ |
| 24 | export function assertLessOrEqual<T>( |
| 25 | actual: T, |
| 26 | expected: T, |
| 27 | msg?: string, |
| 28 | ) { |
| 29 | if (actual <= expected) return; |
| 30 | |
| 31 | const actualString = format(actual); |
| 32 | const expectedString = format(expected); |
| 33 | throw new AssertionError( |
| 34 | msg ?? `Expect ${actualString} <= ${expectedString}`, |
| 35 | ); |
| 36 | } |
no test coverage detected