writing-tests
Skill402 starsChanged 10 months agoApache-2.0View on GitHub
Use when you write or change unit tests or end-to-end tests in browser-sdk.
52 other projects use a version of this.
Adopted by
Most recently taken up by
- basaltbytes/skillstheir own version, first seen Nov 29, 2026
- mattwynne/skillstheir own version, first seen Nov 29, 2026
- dayfinggg/openai-codex-agent-skillstheir own version, first seen Nov 29, 2026
- borkweb/skillstheir own version, first seen Nov 29, 2026
- 851-labs/codevisortheir own version, first seen Nov 29, 2026
- cloudflare/realtimekit-uitheir own version, first seen Nov 29, 2026
Used with
Projects with it also use reviewing-code, commits and 8 more.
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.
ZayZay1nonlySkillreviewing-code
Provides structured code review with prioritized feedback. Use when reviewing PRs, analyzing code quality, checking for bugs, or auditing changes. Triggers on "review this", "check this code", PR reviews, or code quality questions.
Also in 5 projects that use this
JetBrainsSkillcommits
Read before each commit, amend or reword: the subject SafePush accepts and the body.
Also in 3 projects that use this
BlockSkilldebugging
Debugging guidelines and best practices
Also in 5 projects that use this
sahinSkillexecute
Also in 3 projects that use this
MicrosoftSkillcouncil
Convene the persona panel — six orthogonal review lenses — on a target. Cold independent fan-out, debate-to-consensus, synthesized verdict with recorded dissent and a roster manifest.
Also in 4 projects that use this
stericishereSkillgraphify
any input (code, docs, papers, images) → knowledge graph → clustered communities → HTML + JSON + audit report
Also in 3 projects that use this
Other versions52 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 52
- remotion-dev/remotion★ 76ksame name
- PostHog/posthog★ 41ksame name
- JetBrains/intellij-community★ 21ksame name
- quarkusio/quarkus★ 16ksame name
- mcp-use/mcp-use★ 11ksame name
- DetachHead/rebased★ 6.6ksame name
- chattocorp/chatto★ 3ksame name
- starkware-libs/cairo★ 1.9ksame name
- bholmesdev/hubble.md★ 1.5ksame name
- amplifthq/openmeld★ 1.4ksame name
42 more not listed
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.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- handling-dependency-prsSkill
- manual-testingSkill
- running-testsSkill
- triaging-telemetry-errorsSkill
- writing-commits-and-prsSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 52 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use should <expected behavior> when <condition>, e.g.
- Very specific: line 18
Test framework: Jasmine API on Vitest Browser Mode (via a shim in test/unit-vitest/).
- Very specific: line 21
Use registerCleanupTask() for cleanup, NOT afterEach()
- Very specific: line 22
Prefer collectAsyncCalls(spy, n) over waitFor(() => spy.calls.count() > 0) for waiting on spy calls
- Very specific: line 23
Don't destructure methods from spy.calls (e.g., argsFor, mostRecent) - use calls.argsFor() to avoid @typescript-eslint/unbound-method errors
- Distinctive: line 28
Use E2E tests selectively for critical user journeys or failures that lower-level tests cannot catch.
- Distinctive: line 29
Before adding an E2E test, check whether an existing one covers the same workflow.
“Common” is measured: kept by at least 6 in 10 of the 52 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Writing tests in browser-sdk
What to test
- Focus testing on critical paths and complex logic instead of every edge case.
Naming convention
- Use should
<expected behavior>when<condition>, e.g. it('should return link when replay is forced', …). Omit the condition when unnecessary.
Unit Tests
- Test framework: Jasmine API on Vitest Browser Mode (via a shim in
test/unit-vitest/). Spec files co-located with implementation:feature.ts→feature.spec.ts - Focus tests with
fit()/fdescribe(), skip withxit()/xdescribe() - Specs are being migrated from the Jasmine API to the Vitest API. Write new specs with the Vitest API (
import { describe, expect, it, vi } from 'vitest'), unless they depend on a test helper that still returns Jasmine spies. Convert existing specs withnode scripts/test/jasmine-to-vitest.ts <files or directories>, fix what it reports, then add the paths toVITEST_API_SPEC_FILESineslint.config.ts - Use
registerCleanupTask()for cleanup, NOTafterEach() - Prefer
collectAsyncCalls(spy, n)overwaitFor(() => spy.calls.count() > 0)for waiting on spy calls - Don't destructure methods from
spy.calls(e.g.,argsFor,mostRecent) - usecalls.argsFor()to avoid@typescript-eslint/unbound-methoderrors - Mock values/functions: wrap with
mockable()in source, usereplaceMockable()orreplaceMockableWithSpy()in tests (auto-cleanup)
e2e Tests
- Use E2E tests selectively for critical user journeys or failures that lower-level tests cannot catch.
- Before adding an E2E test, check whether an existing one covers the same workflow. Extend it when the new assertion fits its purpose.
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.

