(stackStartFn, actual, error, message)
| 693 | } |
| 694 | |
| 695 | function expectsNoError(stackStartFn, actual, error, message) { |
| 696 | if (actual === NO_EXCEPTION_SENTINEL) |
| 697 | return; |
| 698 | |
| 699 | if (typeof error === 'string') { |
| 700 | message = error; |
| 701 | error = undefined; |
| 702 | } |
| 703 | |
| 704 | if (!error || hasMatchingError(actual, error)) { |
| 705 | const details = message ? `: ${message}` : '.'; |
| 706 | const fnType = stackStartFn === Assert.prototype.doesNotReject ? |
| 707 | 'rejection' : 'exception'; |
| 708 | innerFail({ |
| 709 | actual, |
| 710 | expected: error, |
| 711 | operator: stackStartFn.name, |
| 712 | message: [`Got unwanted ${fnType}${details}\n` + |
| 713 | `Actual message: "${actual?.message}"`], |
| 714 | stackStartFn, |
| 715 | diff: this?.[kOptions]?.diff, |
| 716 | }); |
| 717 | } |
| 718 | throw actual; |
| 719 | } |
| 720 | |
| 721 | /** |
| 722 | * Expects the function `promiseFn` to throw an error. |
no test coverage detected
searching dependent graphs…