v4.0.1
Bug fixes
- Fixed
npm installfailing because the published package didn’t include thescripts/directory that its post-install step runs.
v4.0.0
Doc Detective 4 bundles the test runner, previously published as doc-detective-core, into the doc-detective package. Both doc-detective and the shared schemas package, doc-detective-common, are now ES modules written in TypeScript. Their source moved into the doc-detective repository. See the doc-detective repository guide if you contribute.
Breaking changes
- The
doc-detectivepackage no longer depends ondoc-detective-core. The runner ships insidedoc-detective, and the package now exportsrunTests,getRunner,detectTests,detectAndResolveTests,resolveTests,readFile, andresolvePaths. Version 5 removes every export exceptrunTestsandgetRunner. - Importing
doc-detectivenow loads that programmatic API instead of running the CLI. The CLI entry point moved tobin/doc-detective.jsand is also exported asdoc-detective/cli. - The package is now an ES module with an
exportsmap, so imports of files inside the package (such asdoc-detective/src/index.js) no longer resolve. Bothimportandrequire()work for the package’s main entry point. doc-detective-commonv4 no longer exportsresolvePathsorreadFile. It still exportsschemas,validate,transformToSchemaKey, anddetectTests.
To migrate from Doc Detective 3:
- If you run tests from the command line with
npx doc-detective, no change is needed. Your config files and test specs work as before. - If you import
runTestsorgetRunnerfromdoc-detective-core, installdoc-detectiveand import them fromdoc-detectiveinstead. - If you import
resolvePathsorreadFilefromdoc-detective-common, import them fromdoc-detectiveinstead. - If a script runs a file inside the package directly, run the
doc-detectivecommand instead.
New features
- Added a
--versionflag that prints the installed version. See the CLI reference. - Detected steps now include a read-only
locationobject with the line number and character offsets where the step appears in its source file. - The packages ship TypeScript type definitions.
doc-detective-commonexports theSpecification,Test,Step,Context,Config, andReporttypes. - When you call
detectTestsfromdoc-detective-commonwithout a file type, it picks one from the file extension or the content. The package also exports the built-in file type definitions asdefaultFileTypes.
Bug fixes
- Fixed screen recording on macOS. When Chrome can’t start a screen capture, the
recordstep now fails with an explanation instead of hanging. On macOS, the explanation points to Chrome’s screen recording permission. AstopRecordstep without an active recording now fails cleanly.