(cmdString: string, rule: MockRule)
| 33 | let rules: MockRule[] = []; |
| 34 | |
| 35 | function matchCommand(cmdString: string, rule: MockRule): boolean { |
| 36 | if (typeof rule.match === 'string') { |
| 37 | return cmdString.includes(rule.match); |
| 38 | } |
| 39 | return rule.match.test(cmdString); |
| 40 | } |
| 41 | |
| 42 | function findRule(cmdString: string): MockRule | undefined { |
| 43 | return rules.find((r) => matchCommand(cmdString, r)); |
no outgoing calls
no test coverage detected
searching dependent graphs…