(str, check)
| 43 | } |
| 44 | |
| 45 | function checkOutput(str, check) { |
| 46 | if ((check instanceof RegExp && !check.test(str)) || |
| 47 | (typeof check === 'string' && check !== str)) { |
| 48 | return { passed: false, reason: `did not match ${util.inspect(check)}` }; |
| 49 | } |
| 50 | if (typeof check === 'function') { |
| 51 | try { |
| 52 | check(str); |
| 53 | } catch (error) { |
| 54 | return { |
| 55 | passed: false, |
| 56 | reason: `did not match expectation, checker throws:\n${util.inspect(error)}`, |
| 57 | }; |
| 58 | } |
| 59 | } |
| 60 | return { passed: true }; |
| 61 | } |
| 62 | |
| 63 | function expectSyncExit(caller, spawnArgs, { |
| 64 | status, |
no test coverage detected
searching dependent graphs…