v4.42.1
Maintenance release; no user-facing changes.
v4.42.0
This release prepares version 4 users for Doc Detective 5 and changes how Doc Detective guards local URLs. See Upgrade to Doc Detective 5.
New features
checkLinkhas a newtimeoutfield that sets how long each request attempt waits, in milliseconds. It defaults to10000. When an attempt times out, the step fails with a message that names the URL.- Run reports now record when and where tests ran:
- The report root has
startedAtand anenvironmentobject with the platform, architecture, and Doc Detective, Node.js, and OS versions. - Each context has
startedAtand, when a browser ran, the browser version and the driver’s name and version. - Each step has
startedAt.
- The report root has
- You can now set the pseudo-terminal size for background commands.
background.ttyonrunShellandrunCode, andttyon astartSurfaceprocess descriptor, accept an object such as{"cols": 80, "rows": 24}.truekeeps the 120 by 30 terminal.
Behavior changes
- Doc Detective now warns on stderr when a run relies on something that Doc Detective 5 changes or removes. Examples include CLI flags,
DOC_DETECTIVEenvironment variable keys, reporter names, and spec content that version 5 rejects or reads differently. The warnings link to the upgrade guide and don’t print at thesilentlog level or in the GitHub Action. - Self-update now stays within your current major version. When a newer major version is available, Doc Detective prints the upgrade command instead of updating. Update notices go to stderr, so they don’t mix with
--dry-runJSON output. - Screenshot reference images and OpenAPI
$refs onlocalhost, Docker networks, and private networks now load by default. Previously, they requiredDOC_DETECTIVE_ALLOW_LOCAL_URLS=true.- Doc Detective now refuses a hop from a public address to a private one. Examples include a redirect to a private address and a
$refin a publicly hosted OpenAPI description. After it reads a public description, it also refuses local file$refs. - Set
DOC_DETECTIVE_ALLOW_LOCAL_URLS=1to turn the guard off, orDOC_DETECTIVE_BLOCK_LOCAL_URLS=1to refuse every private address. If you set both, Doc Detective exits with code2. - Requests that steps make, such as
goToandhttpRequest, aren’t affected.
- Doc Detective now refuses a hop from a public address to a private one. Examples include a redirect to a private address and a
- Heretto uploads now start only when an integration sets
uploadOnChangetotrue. Previously, a config that skipped validation uploaded changed screenshots by default. See Heretto. - A boolean click, such as
{"click": true}, now fails with a hint. Previously, Doc Detective clicked an element whose text wastrue. To click that text, quote it:"click": "true".
Bug fixes
find.click: falsenow finds the element without clicking it. Previously, Doc Detective convertedfalseto the text"false"and clicked.wait: trueis no longer read as1either.httpRequestaccepts a single integer forstatusCodes, likecheckLink.$schemanow accepts any URL on specs, tests, steps, contexts, and config files, so you can point your editor at a versioned or local schema. Previously, other URLs failed validation. See Standalone tests.environment.archnow accepts every architecture Node.js reports, such asarmandia32.- Remote files whose URLs have a query string, such as presigned YAML URLs, now parse by the extension in the URL path.
- OpenAPI descriptions that are missing, empty, or invalid now fail with one message that names the cause. A spurious
Failed to parse JSONwarning on remote.jsondescriptions no longer appears. checkLinknetwork errors no longer include a URL’s query string, fragment, or credentials.- When you load Doc Detective with
require("doc-detective"), writing verification results back to your files now works, and lazy dependency installs no longer fail withENOENT.