(rule, input, options = {}, expected)
| 38 | * Tests a YAML rule against a YAML string |
| 39 | */ |
| 40 | export function testYamlRule(rule, input, options = {}, expected) { |
| 41 | // Create a mock reporter |
| 42 | const report = mock.fn(); |
| 43 | |
| 44 | // Execute the rule |
| 45 | rule(input, report, options); |
| 46 | |
| 47 | // Assert that the expected messages were reported |
| 48 | assert.deepEqual( |
| 49 | report.mock.calls.flatMap(call => call.arguments), |
| 50 | expected |
| 51 | ); |
| 52 | } |
no test coverage detected