Skip to content

Validation test for design token JSON examples in the technical report - #414

Open
dgtlntv wants to merge 2 commits into
design-tokens:mainfrom
dgtlntv:pr/03-technical-report-tests
Open

Validation test for design token JSON examples in the technical report#414
dgtlntv wants to merge 2 commits into
design-tokens:mainfrom
dgtlntv:pr/03-technical-report-tests

Conversation

@dgtlntv

@dgtlntv dgtlntv commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

(This PR is stacked on top of #412. So the diff also includes the schema package changes from that PR. The new changes in this PR are focused on the added validation test in the technical report package.)

Changes

Adds a Vitest-based validation test for fenced json and jsonc examples in the technical reports package.

Previously, examples in the technical reports relied on manual inspection. This test automatically extracts examples from the markdown files and validates them against the bundled DTCG JSON Schemas, making it easier to catch invalid examples and markdown/code-block issues.

The test currently checks three things:

  1. examples parse as valid JSONC
  2. blocks tagged as json do not contain JSONC-only features such as comments
  3. examples with a known $schema, or examples detected as DTCG format/resolver examples, validate against the corresponding bundled schema.

Configuration lives in:

technical-reports/tests/tests.config.json

The config defines:

  • which markdown files are scanned
  • where the bundled schemas are loaded from
  • detection rules for examples without $schema
  • exclusions for examples that are intentionally invalid/incomplete.

Current Result

Running the new test currently reports 37 failures (which I think almost all of them are valid failures). I wasn't sure whether I should fix those issues in this PR or in a follow up PR.

How to Review

Run:

pnpm --filter @dtcg/tr test

Check whether the reported failures are legitimate and whether the test behavior/configuration is appropriate.

@netlify

netlify Bot commented Jun 3, 2026

Copy link
Copy Markdown

Deploy Preview for designtokensorg ready!

Name Link
🔨 Latest commit a32cf66
🔍 Latest deploy log https://app.netlify.com/projects/designtokensorg/deploys/6a807e6aa816d00008983f44
😎 Deploy Preview https://deploy-preview-414--designtokensorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@dgtlntv

dgtlntv commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

This would address issue #368

@dgtlntv
dgtlntv force-pushed the pr/03-technical-report-tests branch from 24f2bf1 to 0426105 Compare June 18, 2026 09:19
@dgtlntv
dgtlntv force-pushed the pr/03-technical-report-tests branch from 0426105 to a32cf66 Compare August 15, 2026 14:57
@dgtlntv

dgtlntv commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Hi @drwpow! Just wanted to check if there’s still interest in this PR. If not, I can close it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant