Skip to content

feat(test): add test script to test the output of theme - #230

Merged
avivkeller merged 6 commits into
webpack:mainfrom
moshams272:feat/test-theme
Aug 4, 2026
Merged

avivkeller merged 6 commits into
webpack:mainfrom
moshams272:feat/test-theme

Conversation

@moshams272

Copy link
Copy Markdown
Member

Summary

This PR introduces snapshot testing to ensure that our theme generates the output we need. We use snapshot tool from node:test with the same pipeline using getTypeDocConfig.

How to use

Run the test:

npm run test

To update the snapshot after modifying the fixture or theme:

node --test --test-update-snapshots tests/**/*.test.mjs

@vercel

vercel Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-doc-kit Ready Ready Preview Aug 3, 2026 7:38pm

Request Review

Comment thread scripts/markdown/api/utils.mjs Outdated
Comment thread package.json Outdated
@ryzrr

ryzrr commented Aug 3, 2026

Copy link
Copy Markdown
Member

also can we add the test in the CI, wdyt ?

@moshams272

Copy link
Copy Markdown
Member Author

Oh it fails 😂. it worked on my machine, WIP.

@moshams272

Copy link
Copy Markdown
Member Author

Ok, it works now. The problem is when we import typeDocConfig, the Module Record try to record the sources and it's a top-level await, so it execute and there's no .cache/webpack there so it crashed.

Solving that with using lazy evaluation by isolating it in function.

@avivkeller
avivkeller merged commit 1ae0cf9 into webpack:main Aug 4, 2026
11 checks passed

This branch was successfully deployed

1 active deployment
Preview — 50bda6ed Deployed Aug 3, 2026 by vercel[bot]
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.

3 participants