Skip to content

feat(front-matter/unstable): add test to each subpackage, including JSON, TOML, and YAML#7059

Open
uynilo9 wants to merge 7 commits intodenoland:mainfrom
uynilo9:main
Open

feat(front-matter/unstable): add test to each subpackage, including JSON, TOML, and YAML#7059
uynilo9 wants to merge 7 commits intodenoland:mainfrom
uynilo9:main

Conversation

@uynilo9
Copy link
Copy Markdown

@uynilo9 uynilo9 commented Mar 21, 2026

Let people use the test function more easily when they want to check a specific format of frontmatter.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 21, 2026

CLA assistant check
All committers have signed the CLA.

@uynilo9 uynilo9 changed the title feat(frontmatter/unstable): add test to each subpackage, including JSON, TOML, and YAML feat(front-matter/unstable): add test to each subpackage, including JSON, TOML, and YAML Mar 21, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.38%. Comparing base (260f5b8) to head (bc74fa0).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7059   +/-   ##
=======================================
  Coverage   94.38%   94.38%           
=======================================
  Files         628      630    +2     
  Lines       50175    50190   +15     
  Branches     8840     8840           
=======================================
+ Hits        47357    47372   +15     
  Misses       2251     2251           
  Partials      567      567           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

A few things to address:

  1. unstable_json.ts and unstable_toml.ts duplicate extract() from the stable json.ts and toml.ts. These files should only contain the new test() function — either re-export extract from the stable module or just don't include it.
  2. The JSON test cases use TOML syntax (name = 'deno') as the front matter body. Since test() only validates delimiters this passes, but it's confusing — please use actual JSON content.
  3. Import style is inconsistent: json_test.ts uses the @std/front-matter/unstable-json specifier while toml_test.ts uses a relative ./unstable_toml.ts path. Please use one style consistently.

@uynilo9
Copy link
Copy Markdown
Author

uynilo9 commented Mar 25, 2026

Thanks for reviewing. I didn't realise some absurd mistakes I made since I've been little busy these days.

2. The JSON test cases use TOML syntax (`name = 'deno'`) as the front matter body. Since `test()` only validates delimiters this passes, but it's confusing — please use actual JSON content.

About the second thing you mention, I use the example directly from test_test.ts. Is it also a misused test?

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.

3 participants