( actual: A, // deno-lint-ignore no-explicit-any unexpectedType: abstract new (...args: any[]) => T, msg?: string, )
| 21 | * @param msg The optional message to display if the assertion fails. |
| 22 | */ |
| 23 | export function assertNotInstanceOf<A, T>( |
| 24 | actual: A, |
| 25 | // deno-lint-ignore no-explicit-any |
| 26 | unexpectedType: abstract new (...args: any[]) => T, |
| 27 | msg?: string, |
| 28 | ): asserts actual is Exclude<A, T> { |
| 29 | const msgSuffix = msg ? `: ${msg}` : "."; |
| 30 | msg = |
| 31 | `Expected object to not be an instance of "${typeof unexpectedType}"${msgSuffix}`; |
| 32 | assertFalse(actual instanceof unexpectedType, msg); |
| 33 | } |
no test coverage detected