( actual: T, expected: T, msg?: string, )
| 25 | * @param msg The optional message to display if the assertion fails. |
| 26 | */ |
| 27 | export function assertNotStrictEquals<T>( |
| 28 | actual: T, |
| 29 | expected: T, |
| 30 | msg?: string, |
| 31 | ) { |
| 32 | if (!Object.is(actual, expected)) { |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | const msgSuffix = msg ? `: ${msg}` : "."; |
| 37 | throw new AssertionError( |
| 38 | `Expected "actual" to not be strictly equal to: ${ |
| 39 | format(actual) |
| 40 | }${msgSuffix}\n`, |
| 41 | ); |
| 42 | } |
no test coverage detected