Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.

docs: Document test detection enhancements and source location tracking#23

Closed
promptless[bot] wants to merge 1 commit intomainfrom
promptless/enhance-test-detection-docs
Closed

docs: Document test detection enhancements and source location tracking#23
promptless[bot] wants to merge 1 commit intomainfrom
promptless/enhance-test-detection-docs

Conversation

@promptless
Copy link
Contributor

@promptless promptless bot commented Mar 11, 2026

Open this suggestion in Promptless to view citations and reasoning process

Updates documentation to reflect PR #197 changes: clarifies that detectSteps is now enabled by default, documents the new location property on detected steps for source file tracking, and expands the doc-detective-common package documentation with its public exports including defaultFileTypes and FileType.

Trigger Events

doc-detective/doc-detective PR #197: Refactor test detection and enhance file type handling

Promptless Research (9 files, 1 GitHub PR)

  • Reviewed doc-detective/doc-detective#197
  • Viewed .long_term_context/product_knowledge/product_overview.md
  • Viewed .long_term_context/doc_workflow/client_instructions.md
  • Viewed .long_term_context/style/client_style_guide.md
  • Viewed fern/pages/docs/tests/detected.mdx
  • Viewed fern/pages/docs/input-formats/overview.mdx
  • Viewed fern/pages/reference/schemas/config.md
  • Viewed fern/pages/contribute/repos/doc-detective-common.md
  • Viewed fern/pages/reference/schemas/common.md
  • Viewed fern/docs.yml

Agent Response

I've reviewed PR #197 (Refactor test detection and enhance file type handling) and created documentation updates to cover the changes.

Documentation Changes

I created a suggestion with the following updates:

1. Detected tests page (fern/pages/docs/tests/detected.mdx)

  • Clarified that detectSteps is now enabled by default (users no longer need to explicitly set it to true)
  • Added a new Source location tracking section documenting the location property that detected steps now include, with line, startIndex, and endIndex fields for debugging

2. Common step schema (fern/pages/reference/schemas/common.md)

  • Added the new location field to the step schema reference

3. Source Location schema (fern/pages/reference/schemas/source-location.md)

  • Created a new schema reference page documenting the Source Location object structure

4. doc-detective-common package docs (fern/pages/contribute/repos/doc-detective-common.md)

  • Expanded documentation to include:
    • All public type exports (Specification, Test, Step, Context, Config, Report, FileType)
    • Utility exports (schemas, validate(), detectTests(), defaultFileTypes)
    • Example usage code

The suggestion is ready for your review.


Tip: Connect Jira, Linear, Confluence, and more in Integrations to enrich suggestion quality 🔗

---

Doc Detective can automatically generate tests based on your documentation source files and your `fileTypes` configuration. Detected tests are useful for large, complex test suites that you want to keep in sync with your documentation. Test detection works by setting `detectSteps` to `true` and defining markup patterns and associated actions in the `fileTypes.markup` array in your [config](/reference/schemas/config), which Doc Detective uses to extract steps from your doc source files. You can define multiple test patterns in your config to extract different types of tests from your documentation.
Doc Detective can automatically generate tests based on your documentation source files and your `fileTypes` configuration. Detected tests are useful for large, complex test suites that you want to keep in sync with your documentation. Test detection is enabled by default (`detectSteps: true`) and uses markup patterns and associated actions defined in the `fileTypes.markup` array in your [config](/reference/schemas/config) to extract steps from your doc source files. You can define multiple test patterns in your config to extract different types of tests from your documentation.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation: Updated to clarify detectSteps defaults to true. Based on change in src/common/src/detectTests.ts where config.detectSteps ?? true now defaults to true when not specified.
View source


Combine detected tests with [inline tests](./inline-tests) for comprehensive test coverage with minimal manual effort.

## Source location tracking
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation: New section documenting the location property added to detected steps. Based on changes in src/common/src/detectTests.ts that add _startIndex, _endIndex, and _line tracking, plus new schema properties in output schemas.
View source

outputs | object(Outputs (step)) | Optional. Outputs from step processes and user-defined expressions. Use the `outputs` object to reference outputs in subsequent steps. If a user-defined output matches the key for a step-defined output, the user-defined output takes precedence. | ``{}``
variables | object(Variables (step)) | Optional. Environment variables to set from user-defined expressions. | ``{}``
breakpoint | boolean | Optional. Whether or not this step should act as a breakpoint when debugging is enabled. When `true`, execution will pause at this step when debug mode is enabled. | `false`
location | object([Source Location](/reference/schemas/source-location)) | ReadOnly. Source location where this step was detected in the original file. This is system-populated metadata for [detected tests](/docs/tests/detected) and should not be set manually. |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation: Added location field to step schema. Based on new location object added in step_v3.schema.json with line, startIndex, and endIndex properties.
View source

- `schemas`: All JSON schemas for validation
- `validate()`: Validate objects against Doc Detective schemas
- `detectTests()`: Detect tests from documentation content
- `defaultFileTypes`: Default file type definitions for Markdown, HTML, AsciiDoc, and DITA
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation: Documented defaultFileTypes export. Based on new src/common/src/fileTypes.ts module that exports defaultFileTypes and FileType, plus updates to src/common/src/index.ts exports.
View source

@github-actions
Copy link

@promptless promptless bot closed this Mar 12, 2026
@promptless promptless bot marked this pull request as ready for review March 12, 2026 02:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants