Skip to content

docs: run example snippets that were needlessly excluded from doc tests#7242

Open
tomas-zijdemans wants to merge 2 commits into
denoland:mainfrom
tomas-zijdemans:docs/remove-unnecessary-ignore-directives
Open

docs: run example snippets that were needlessly excluded from doc tests#7242
tomas-zijdemans wants to merge 2 commits into
denoland:mainfrom
tomas-zijdemans:docs/remove-unnecessary-ignore-directives

Conversation

@tomas-zijdemans

@tomas-zijdemans tomas-zijdemans commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

This PR removes the ignore directive from 111 JSDoc example snippets that type-check, run, and pass as-is. They now execute as doc tests instead of sitting in the docs as dead code.

I audited all 370 ```ts ignore fences in the repo. Most earn their ignore: failing-assertion demos, Deno.serve on fixed ports, BDD examples that can't nest inside a doc test. These 111 don't. They're read-only, deterministic, and local. Things like walk("."), exists() checks, and the 42 console.log-only examples in cli/unstable_ansi.ts. Also resolves the TODO(iuioiua) in async/abortable.ts and async/unstable_abortable.ts, whose examples pass cleanly under --trace-leaks on current Deno.

Note for reviewers: 79 of these snippets don't assert anything, so check_docs.ts flags them once they lose ignore (that's what failed the first lint run here). Those fences are now ```ts no-assert: they still run as doc tests, the checker just knows the missing assertion is intentional. That's the whole diff on those lines.

Deliberately left ignored, for a possible follow-up:

  • Anything fetching live URLs (offline CI would flake)
  • Snippets reading stdin or piping to Deno.stdout.writable (pipeTo closes stdout)
  • tar/tar_stream.ts examples that write out.tar.gz into the cwd
  • Four fs/walk.ts followSymlinks examples that actually fail: walking . hits a broken symlink in fs/testdata/copy_dir_link_file/

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.03%. Comparing base (ad7c87b) to head (ea3fd22).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7242      +/-   ##
==========================================
+ Coverage   95.00%   95.03%   +0.02%     
==========================================
  Files         617      617              
  Lines       51674    51503     -171     
  Branches     9326     9283      -43     
==========================================
- Hits        49093    48944     -149     
+ Misses       2038     2023      -15     
+ Partials      543      536       -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant