test(gutenberg-to-portable-text): add transform tests#332
test(gutenberg-to-portable-text): add transform tests#332ascorbic merged 4 commits intoemdash-cms:mainfrom
Conversation
|
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Pull request overview
Adds broader automated coverage for the gutenberg-to-portable-text converter and tightens TypeScript compiler checks.
Changes:
- Added new conversion tests for basic HTML input, embeds (including provider inference), tables, buttons/buttons container, and galleries.
- Added inline parser edge-case tests for empty
hrefand unsafe/unknown URL schemes. - Enabled
noUnusedLocalsand removed a few now-flagged unused locals/imports.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/gutenberg-to-portable-text/tsconfig.json | Enables noUnusedLocals for stricter TS hygiene. |
| packages/gutenberg-to-portable-text/tests/inline.test.ts | Adds inline parsing edge-case tests for links. |
| packages/gutenberg-to-portable-text/tests/converter.test.ts | Adds/extends converter test coverage across more block types and embed providers. |
| packages/gutenberg-to-portable-text/src/transformers/core.ts | Removes an unused table-related local. |
| packages/gutenberg-to-portable-text/src/index.ts | Removes unused transformer imports (keeps re-exports). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This adds a bunch of tests, mostly for the transformers but also some minor edge cases in the inline parser, too. It also enables `noUnusedLocals` in `tsconfig.json` which caught a couple of unused things.
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
What does this PR do?
This adds a bunch of tests, mostly for the transformers but also some
minor edge cases in the inline parser, too.
It also enables
noUnusedLocalsintsconfig.jsonwhich caught acouple of unused things.
Type of change
Checklist
pnpm typecheckpassespnpm --silent lint:json | jq '.diagnostics | length'returns 0pnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure