MCPcopy Create free account
hub / github.com/nodejs/nodejs.org / testYamlRule

Function testYamlRule

packages/remark-lint/src/rules/__tests__/utils.mjs:40–52  ·  view source on GitHub ↗
(rule, input, options = {}, expected)

Source from the content-addressed store, hash-verified

38 * Tests a YAML rule against a YAML string
39 */
40export 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}

Calls 1

ruleFunction · 0.85

Tested by

no test coverage detected