Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

Replaces web-test-runner with vitest running tests in browser mode via Playwright/Chromium.

Changes

Test runner configuration

  • Add vitest.config.ts with browser mode enabled, Playwright provider, Chromium instance
  • Update test script: web-test-runnervitest run
  • Remove web-test-runner.config.js and dependencies (@web/test-runner, @web/dev-server-esbuild)

Test utilities

  • Create test/test-utils.ts providing fixture() and html() helpers (replaces @open-wc/testing)
  • Create test/setup.ts configuring chai-dom and sinon-chai plugins using vitest's built-in chai
  • Update all test imports from @open-wc/testing to ./test-utils.js

TypeScript configuration

  • Add types: ["vitest/globals"] for test globals (describe, it, expect, etc.)
  • Add skipLibCheck: true to avoid chai type conflicts between vitest and transitive dependencies

Dependencies

  • Add: vitest, @vitest/browser, @vitest/browser-playwright, playwright, chai-dom, sinon-chai
  • Remove: @web/test-runner, @web/dev-server-esbuild

Example

// test/test-utils.ts
export async function fixture<T extends HTMLElement>(template: string): Promise<T> {
  const container = document.createElement('div')
  container.innerHTML = template.trim()
  const element = container.firstElementChild as T
  document.body.appendChild(element)
  await new Promise(resolve => requestAnimationFrame(resolve))
  return element
}

export function html(strings: TemplateStringsArray, ...values: unknown[]): string {
  return strings.reduce((result, str, i) => result + str + (values[i] ?? ''), '')
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=3500 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/puppeteer_dev_chrome_profile-xzu4Tl --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1097686444200197014,6574062328990545257,262144 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=BackForwardCache,PaintHolding,Translate --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome-stable --disable-REDACTED-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=Translate,BackForwardCache --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-sync --force-color-profile=srgb --metrics-recording-only (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=3500 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/puppeteer_dev_chrome_profile-xzu4Tl --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1097686444200197014,6574062328990545257,262144 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=BackForwardCache,PaintHolding,Translate --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome-stable --disable-REDACTED-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=Translate,BackForwardCache --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-sync --force-color-profile=srgb --metrics-recording-only (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/143.0.7499.4/linux64/chrome-headless-shell-linux64.zip
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/catalyst/catalyst/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js (http block)
  • https://storage.googleapis.com/chrome-for-testing-public/143.0.7499.4/linux64/chrome-linux64.zip
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/catalyst/catalyst/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js (http block)
  • safebrowsingohttpgateway.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=3500 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/puppeteer_dev_chrome_profile-xzu4Tl --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1097686444200197014,6574062328990545257,262144 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=BackForwardCache,PaintHolding,Translate --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome-stable --disable-REDACTED-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=Translate,BackForwardCache --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-sync --force-color-profile=srgb --metrics-recording-only (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=3500 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/puppeteer_dev_chrome_profile-xzu4Tl --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,1097686444200197014,6574062328990545257,262144 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=BackForwardCache,PaintHolding,Translate --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome-stable --disable-REDACTED-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=Translate,BackForwardCache --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-sync --force-color-profile=srgb --metrics-recording-only (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 19, 2026 12:24
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
Copilot AI changed the title [WIP] Update testing framework from web-test-runner to vitest Migrate from web-test-runner to vitest in browser mode Jan 19, 2026
Copilot AI requested a review from dgreif January 19, 2026 12:35
@dgreif
Copy link
Contributor

dgreif commented Jan 19, 2026

I got the tests passing in a different branch so no need to convert for now.

@dgreif dgreif closed this Jan 19, 2026
@dgreif dgreif deleted the copilot/update-to-vitest-browser branch January 19, 2026 13:09
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