Skip to content

chore: web-test-runner - #1917

Draft
daniel-graham-amplitude wants to merge 1 commit into
mainfrom
no-ticket-web-test-runner
Draft

chore: web-test-runner#1917
daniel-graham-amplitude wants to merge 1 commit into
mainfrom
no-ticket-web-test-runner

Conversation

@daniel-graham-amplitude

@daniel-graham-amplitude daniel-graham-amplitude commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Experiment with test-runner integration testing

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

Note

Low Risk
Test infrastructure and a non-runtime types re-export split; no production SDK behavior changes.

Overview
Adds browser integration testing for @amplitude/analytics-browser using @web/test-runner with Playwright (Chromium, Firefox, WebKit), esbuild, and Rollup CommonJS for node_modules.

New test:integration script and web-test-runner.config.mjs serve from the monorepo root so pnpm workspace packages resolve. Smoke coverage includes track/identify/flush (smoke.test.ts), DOM click → track (smoke.test.html), and opt-out behavior.

src/types.ts now uses separate export type vs value export blocks from @amplitude/analytics-core (likely to satisfy the browser test bundler). Lockfile picks up the new devDependencies.

Reviewed by Cursor Bugbot for commit 75d9fd0. Bugbot is set up for automated code reviews on this repo. Configure here.

@daniel-graham-amplitude
daniel-graham-amplitude requested a review from a team as a code owner July 30, 2026 17:20
@daniel-graham-amplitude
daniel-graham-amplitude marked this pull request as draft July 30, 2026 17:20

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Orphaned lockfile package entry
    • Removed the orphaned packages/test-analytics-browser importer from pnpm-lock.yaml; pnpm install confirms the lockfile matches the real workspace.

Create PR

Or push these changes by commenting:

@cursor push a2a6f44315
Preview (a2a6f44315)
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1154,15 +1154,6 @@
         specifier: ^7.0.2
         version: 7.0.2(rollup@2.79.2)
 
-  packages/test-analytics-browser:
-    devDependencies:
-      '@esm-bundle/chai':
-        specifier: ^4.3.4
-        version: 4.3.4
-      '@web/test-runner':
-        specifier: ^0.20.2
-        version: 0.20.2
-
   packages/unified:
     dependencies:
       '@amplitude/analytics-browser':

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 75d9fd0. Configure here.

Comment thread pnpm-lock.yaml
'@web/test-runner':
specifier: ^0.20.2
version: 0.20.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Orphaned lockfile package entry

Low Severity

The lockfile gains an importers entry for packages/test-analytics-browser with @esm-bundle/chai and @web/test-runner, but that workspace package does not exist in the repo (only analytics-browser-test does). This looks like leftover state from the web-test-runner experiment.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 75d9fd0. Configure here.

@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 61.28 KB (0%)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 134.97 KB (0%)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 215.36 KB (0%)
@amplitude/element-selector (gzipped esm) 2.67 KB (0%)

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