Skip to content

Commit c697300

Browse files
authored
Merge pull request #2 from doc-detective/coderabbitai/docstrings/7Cj
📝 Add docstrings to `rc`
2 parents 9b5a822 + a8c614b commit c697300

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

dev/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ const path = require("path");
55

66
main();
77

8+
/**
9+
* Detects and resolves test cases in a specified markdown file using configured patterns and actions, then outputs the results to a JSON file.
10+
*
11+
* The function analyzes the input markdown file for test-related statements and code blocks according to the provided configuration, processes detected tests, and writes the structured results to "output.json" in the current directory.
12+
*/
813
async function main() {
914
const json = {
1015
input: "/home/hawkeyexl/Workspaces/resolver/dev/doc-content copy.md",

src/utils.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,18 @@ async function isValidSourceFile({ config, files, source }) {
251251
return true;
252252
}
253253

254+
/**
255+
* Parses raw test content into an array of structured test objects.
256+
*
257+
* Processes input content using inline statement and markup regex patterns defined by {@link fileType}, extracting test and step definitions. Supports detection of test boundaries, ignored sections, and step definitions, including batch markup matches. Converts and validates extracted objects against the test and step schemas, handling both v2 and v3 formats. Returns an array of validated test objects with their associated steps.
258+
*
259+
* @param {Object} options - Options for parsing.
260+
* @param {Object} options.config - Test configuration object.
261+
* @param {string|Object} options.content - Raw file content as a string or object.
262+
* @param {string} options.filePath - Path to the file being parsed.
263+
* @param {Object} options.fileType - File type definition containing parsing rules.
264+
* @returns {Array<Object>} Array of parsed and validated test objects.
265+
*/
254266
async function parseContent({ config, content, filePath, fileType }) {
255267
const statements = [];
256268
const statementTypes = [

0 commit comments

Comments
 (0)