running-tests
Skill400 starsChanged 9 months agoApache-2.0View on GitHub
Use when running tests or checks in browser-sdk, including unit (Karma/Jasmine), E2E (Playwright), script tests, TypeScript/SSR compatibility, performance benchmarks, or BrowserStack. Use when choosing a yarn test command, reproducing a flaky seed, or targeting a spec, a browser, or a pinned old browser.
- Reads credentials
Files
Running Tests in browser-sdk
Overview
All test entry points are root yarn scripts. Unit tests compile from source. Locally, E2E tests only run the bundle setup, which loads SDK bundles compiled from source by the dev server. Tests using npmSetup or a built test app (withApp, extensions, Next.js, Vue, Nuxt) and the performance scenarios don't see a source change until you run yarn build:apps. When unsure, run it. In CI, tests without an explicit setup run on async, npm and bundle, using built packages.
Quick Reference
| Need | Command |
Unit, watch mode (localhost:9876, /debug.html for devtools) | yarn test |
| Unit, single run | yarn test:unit |
Specific specs (repeatable, quoted globs OK, also works with yarn test) | yarn test:unit --spec 'packages/browser-rum-core/src/domain/view/**/*.spec.ts' |
Reproduce a CI order (Randomized with seed 41027) | yarn test:unit --seed 41027 |
Unit on BrowserStack (BS_USERNAME/BS_ACCESS_KEY in env or .env) | yarn test:unit:bs |
Script tests (scripts/**/*.spec.ts) | yarn test:script |
One script spec (yarn test:script <file> still runs all of them) | node --test --experimental-test-module-mocks scripts/lib/foo.spec.ts |
| E2E (local default: chromium only) | yarn test:e2e |
E2E filtered (-g matches file names and test titles) | yarn test:e2e -g "unhandled rejections" |
| E2E on other browsers | yarn test:e2e --project=chromium --project=firefox --project=webkit |
| E2E on pinned old browsers (Chrome 120, Firefox 119, WebKit 17.4) | yarn test:e2e --project=chromium-pinned --project=firefox-pinned --project=webkit-pinned |
| E2E interactive | yarn test:e2e --ui |
TypeScript compatibility (3.8.2, 4.1.6, latest, isolatedModules, exactOptionalPropertyTypes) | yarn test:compat:tsc |
SSR compatibility (imports the SDK in Node, catches top-level window access) | yarn test:compat:ssr |
| Performance benchmarks (CI repeats each scenario 15x) | yarn test:performance (or :debug, :ui) |
Rebuild Before E2E and Performance
yarn build:apps # packs every package (prepack runs yarn build), then builds every test app
yarn build:apps --app vanilla # still packs every package, only rebuilds the vanilla appPerformance tests serve the react-heavy-spa and react-shopist-like apps. Both compat checks pack everything themselves, so they need no rebuild (but they're slow).
One-time setup: yarn test:e2e:setup for E2E, plus yarn test:e2e:setup:pinned for the *-pinned projects.
Common Mistakes
| Mistake | Fix |
Running npmSetup/app-based E2E or perf tests right after editing SDK source | yarn build:apps first, otherwise they use stale packages |
E2E passes locally, fails in CI on <test> > npm | Locally only bundle runs. yarn build:apps, then CI=1 yarn test:e2e --project=<browser> -g "<test>" runs async, npm and bundle like CI. <browser> comes from the job name, e.g. e2e: [firefox] |
Expecting yarn test:e2e to cover all browsers | Locally only chromium runs unless you pass --project |
*-pinned projects fail on missing browsers | yarn test:e2e:setup:pinned once |
Leaving fit/fdescribe in a spec | yarn lint fails (jasmine/no-focused-tests). test.only fails E2E in CI (forbidOnly) |
Passing a path to yarn test:script | Run node --test on the file directly |
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- NangoHQ/nango★ 13ksame name
- dotnet/winforms★ 4.9ksame name
- stellar/stellar-core★ 3.3ksame name
- openai/openai-dotnet★ 2.7ksame name
- cuthbertLab/music21★ 2.6ksame name
- aiidateam/aiida-core★ 605same name
- ZaxbyHub/opencode-swarm★ 517same name
- zaxbysauce/opencode-swarm★ 517same name
- Luqueee/kivgraph★ 21same name
- codeverbojan/claude-code-kickstart★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use writing-tests.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
JetBrainsSkillwriting-tests
Write IntelliJ JUnit 5 tests with fixtures, lifecycle, and EDT.
Also in 3 projects that use this
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- .cursor/rules/test-driven-development.mdcCursor rule
- .cursor/rules/unit-test-best-practices.mdcCursor rule
- manual-testingSkill
- writing-commits-and-prsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

