(expectFailure)
| 526 | } |
| 527 | |
| 528 | function parseExpectFailure(expectFailure) { |
| 529 | if (expectFailure === undefined || expectFailure === false) { |
| 530 | return false; |
| 531 | } |
| 532 | |
| 533 | if (typeof expectFailure === 'string') { |
| 534 | return { __proto__: null, label: expectFailure, match: undefined }; |
| 535 | } |
| 536 | |
| 537 | if (typeof expectFailure === 'function' || isRegExp(expectFailure)) { |
| 538 | return { __proto__: null, label: undefined, match: expectFailure }; |
| 539 | } |
| 540 | |
| 541 | if (typeof expectFailure !== 'object') { |
| 542 | return { __proto__: null, label: undefined, match: undefined }; |
| 543 | } |
| 544 | |
| 545 | const keys = ObjectKeys(expectFailure); |
| 546 | if (keys.length === 0) { |
| 547 | throw new ERR_INVALID_ARG_VALUE('options.expectFailure', expectFailure, 'must not be an empty object'); |
| 548 | } |
| 549 | |
| 550 | if (ArrayPrototypeEvery(keys, (k) => k === 'match' || k === 'label')) { |
| 551 | return { |
| 552 | __proto__: null, |
| 553 | label: expectFailure.label, |
| 554 | match: expectFailure.match, |
| 555 | }; |
| 556 | } |
| 557 | |
| 558 | return { __proto__: null, label: undefined, match: expectFailure }; |
| 559 | } |
| 560 | |
| 561 | class Test extends AsyncResource { |
| 562 | reportedType = 'test'; |
no outgoing calls
no test coverage detected
searching dependent graphs…