( helper: unknown, file: string, name: string, label: string )
| 1585 | |
| 1586 | // a mock, or a module a test runner replaced, fails |
| 1587 | export const checkHelper = ( |
| 1588 | helper: unknown, |
| 1589 | file: string, |
| 1590 | name: string, |
| 1591 | label: string |
| 1592 | ): void => { |
| 1593 | const registered = ( |
| 1594 | Reflect.get(globalThis, helpersKey) as |
| 1595 | | Record<string, Record<string, unknown>> |
| 1596 | | undefined |
| 1597 | )?.[file] |
| 1598 | if (!registered || !(name in registered) || registered[name] !== helper) { |
| 1599 | throwError( |
| 1600 | writeCreationMismatchMessage( |
| 1601 | label, |
| 1602 | describeValue(helper), |
| 1603 | `the function ${file} exports as \`${name}\`` |
| 1604 | ) |
| 1605 | ) |
| 1606 | } |
| 1607 | } |
| 1608 | |
| 1609 | const isValidator = (value: unknown) => value instanceof Validator |
| 1610 |
nothing calls this directly
no test coverage detected