Skip to content

test(svelte): run browser tests in ci - #619

Merged
farnabaz merged 1 commit into
mainfrom
test/svelte-run-browser-tests-in-ci
Nov 19, 2026
Merged

farnabaz merged 1 commit into
mainfrom
test/svelte-run-browser-tests-in-ci

Conversation

@larbish

@larbish larbish commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Run the @comark/svelte browser tests (client Vitest project, 77 tests) in CI, and fix the one that broke on main while they were skipped.

Why

packages/comark-svelte/vitest.config.ts dropped the client project whenever CI or GITHUB_ACTIONS was set. The guard came in with the package split (#34). Chromium was added to CI the same day (#54), but the guard stayed, so CI ran only the 69 server tests. @comark/react has no such guard and runs its browser tests in CI.

While they were skipped, #611 broke one of them. Default slot content next to named slots is now unwrapped, so getByText('Default slot content.') no longer matches an element. #611 updated the matching server test but missed this one.

  • Removed the isCI guard so the client project always runs in Chromium.
  • The named-slot browser test now checks the card's text and that no <p> wraps the default slot. This matches the server test ('</h3> Default slot content. <footer>').

Evidence

CI=true GITHUB_ACTIONS=true pnpm vitest run in packages/comark-svelte, with the guard removed and the old assertion:

 Test Files  1 failed | 16 passed (17)
      Tests  1 failed | 145 passed (146)

With the fixed assertion:

 Test Files  17 passed (17)
      Tests  146 passed (146)

Notes

The bundle size check fails locally on comark (458k against a 457k snapshot). The latest main CI run fails the same way, so it's unrelated to this PR.

ELI5

Some of the Svelte tests only ran on developers' machines and were turned off on the build server, so one of them broke and nobody noticed. This turns them back on everywhere and fixes the broken one to expect the new, correct output.

🤖 Generated with Amp, reviewed by @larbish before opening.

Summary by CodeRabbit

  • Tests
    • Client-side tests now use a consistent browser configuration in CI and local environments.
    • Named-slot coverage verifies that a card displays its title, default content, and footer content together without rendering an extra paragraph.

@larbish
larbish requested a review from farnabaz as a code owner November 19, 2026 15:08
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
comark-svelte Ready Ready Preview Nov 19, 2026 3:09pm UTC
comark-sveltekit Ready Ready Preview Nov 19, 2026 3:09pm UTC
7 Skipped Deployments
Project Deployment Actions Updated
comark Skipped Skipped Nov 19, 2026 3:09pm UTC
comark-binding Skipped Skipped Nov 19, 2026 3:09pm UTC
comark-json-render Skipped Skipped Nov 19, 2026 3:09pm UTC
comark-nextjs Skipped Skipped Nov 19, 2026 3:09pm UTC
comark-nuxt Skipped Skipped Nov 19, 2026 3:09pm UTC
comark-twoslash Skipped Skipped Nov 19, 2026 3:09pm UTC
comark-vue Skipped Skipped Nov 19, 2026 3:09pm UTC

@vercel
vercel Bot temporarily deployed to Preview – comark-nextjs November 19, 2026 15:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – comark-vue November 19, 2026 15:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – comark-twoslash November 19, 2026 15:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – comark-json-render November 19, 2026 15:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – comark-binding November 19, 2026 15:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – comark-nuxt November 19, 2026 15:08 Inactive
@coldtea-pr-lens

Copy link
Copy Markdown

Note

The title starts with test(svelte):, so PR Lens left this pull request undrawn. Comment @pr-lens draw to draw it

github.comment.notice: false in .github/pr-lens.yml turns this note off

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Vitest client project is now configured in all environments. The CardWithFooter test checks the combined title, default-slot, and footer content, and asserts that no paragraph element is rendered.

Changes: Named-slot rendering

Layer / File(s) Summary
Configure and assert named-slot rendering
packages/comark-svelte/vitest.config.ts, packages/comark-svelte/test/MarkdownNode.svelte.test.ts
The client project is included in every environment, and the project list no longer filters falsey entries. The CardWithFooter test checks the combined card text and confirms that no paragraph element is rendered.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • comarkdown/comark#611: Changes default-slot auto-unwrapping next to named slots and updates a related Svelte slot test.
Merge Risk: Minimal · up to d882c

This change enables the browser tests in CI and adjusts one test assertion to match the current rendered output. It does not alter runtime package behavior, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test(svelte): run browser tests in ci" matches the main change. The PR removes the CI guard in vitest.config.ts so the Svelte client Vitest project runs in Chromium during CI. It also updat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(svelte): run browser tests in ci" matches the main change. The PR removes the CI guard in vitest.config.ts so the Svelte client Vitest project runs in Chromium during CI. It also updates the named-slot browser test that no longer matches the rendered output. The title is specific and short, and it names the affected package.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fbc2e9fb-5ce0-459f-a973-747ff8491918
Commits

Reviewing files that changed from the base of the PR and between 12a2874 and d882cb1.

Files selected for processing: 2

  • packages/comark-svelte/test/MarkdownNode.svelte.test.ts
  • packages/comark-svelte/vitest.config.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@pkg-pr-new

pkg-pr-new Bot commented Nov 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

comark

npm i https://pkg.pr.new/comark@619

@comark/angular

npm i https://pkg.pr.new/@comark/angular@619

@comark/ansi

npm i https://pkg.pr.new/@comark/ansi@619

@comark/html

npm i https://pkg.pr.new/@comark/html@619

@comark/nuxt

npm i https://pkg.pr.new/@comark/nuxt@619

@comark/react

npm i https://pkg.pr.new/@comark/react@619

@comark/svelte

npm i https://pkg.pr.new/@comark/svelte@619

@comark/vue

npm i https://pkg.pr.new/@comark/vue@619

commit: d882cb1

@codspeed

codspeed Bot commented Nov 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 3 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 44 untouched benchmarks


Comparing test/svelte-run-browser-tests-in-ci (d882cb1) with main (12a2874)

Open in CodSpeed

@farnabaz farnabaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, Thanks

@farnabaz
farnabaz merged commit 382d146 into main Nov 19, 2026
16 checks passed
@farnabaz
farnabaz deleted the test/svelte-run-browser-tests-in-ci branch November 19, 2026 15:20
@github-actions github-actions Bot mentioned this pull request Nov 19, 2026

This branch was successfully deployed

2 active and 6 inactive deployments
Preview – comark-sveltekit — d882cb14 Deployed Nov 19, 2026 by vercel[bot]
Preview – comark-svelte — d882cb14 Deployed Nov 19, 2026 by vercel[bot]
Preview – comark-nextjs — d882cb14 Deployed Nov 19, 2026 by vercel[bot]
Preview – comark-vue — d882cb14 Deployed Nov 19, 2026 by vercel[bot]
Preview – comark-twoslash — d882cb14 Deployed Nov 19, 2026 by vercel[bot]
Preview – comark-json-render — d882cb14 Deployed Nov 19, 2026 by vercel[bot]
Preview – comark-binding — d882cb14 Deployed Nov 19, 2026 by vercel[bot]
Preview – comark-nuxt — d882cb14 Deployed Nov 19, 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.

2 participants