Write Tests
grafana/synthetic-monitoring-app
Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.
Write or extend Jest tests for OpenPlayerJS to this repo's exact conventions — makeCore factories, typed internals handles instead of as any, media property mocking, fake timers, ads/vast mocks, and…
$ npx skills add openplayerjs/openplayerjs --skill write-tests -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install openplayerjs/openplayerjs write-tests --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/openplayerjs/openplayerjs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/write-tests .claude/skills/write-tests && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "write-tests" agent skill from https://github.com/openplayerjs/openplayerjs/tree/master/.claude/skills/write-tests into .claude/skills/write-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tests", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/openplayerjs/openplayerjs/tree/master/.claude/skills/write-testsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add openplayerjs/openplayerjs --skill write-tests -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install openplayerjs/openplayerjs write-tests --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openplayerjs/openplayerjs.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/write-tests .agents/skills/write-tests && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "write-tests" agent skill from https://github.com/openplayerjs/openplayerjs/tree/master/.claude/skills/write-tests into .agents/skills/write-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tests", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add openplayerjs/openplayerjs --skill write-tests -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install openplayerjs/openplayerjs write-tests --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openplayerjs/openplayerjs.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/write-tests .cursor/skills/write-tests && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "write-tests" agent skill from https://github.com/openplayerjs/openplayerjs/tree/master/.claude/skills/write-tests into .cursor/skills/write-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tests", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/openplayerjs/openplayerjs.git --path .claude/skills/write-tests--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add openplayerjs/openplayerjs --skill write-tests -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install openplayerjs/openplayerjs write-tests --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openplayerjs/openplayerjs.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/write-tests .gemini/skills/write-tests && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "write-tests" agent skill from https://github.com/openplayerjs/openplayerjs/tree/master/.claude/skills/write-tests into .gemini/skills/write-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tests", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install openplayerjs/openplayerjs write-testsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add openplayerjs/openplayerjs --skill write-tests -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/openplayerjs/openplayerjs.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/write-tests .github/skills/write-tests && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "write-tests" agent skill from https://github.com/openplayerjs/openplayerjs/tree/master/.claude/skills/write-tests into .github/skills/write-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tests", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add openplayerjs/openplayerjs --skill write-tests -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install openplayerjs/openplayerjs write-tests --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openplayerjs/openplayerjs.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/write-tests .opencode/skills/write-tests && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "write-tests" agent skill from https://github.com/openplayerjs/openplayerjs/tree/master/.claude/skills/write-tests into .opencode/skills/write-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tests", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
write-testsWrite or extend Jest tests for OpenPlayerJS to this repo's exact conventions — makeCore factories, typed internals handles instead of as any, media property mocking, fake timers, ads/vast mocks, and…
Write Tests is an agent skill from openplayerjs/openplayerjs. Write or extend Jest tests for OpenPlayerJS to this repo's exact conventions — makeCore factories, typed internals handles instead of as any, media property mocking, fake timers, ads/vast mocks, and coverage-gap targeting. Use when asked to add tests, raise coverage, fix the 85% threshold, or when a bug fix needs its regression test.
Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Testing & QA, covering Test generation, Unit testing and Debugging. It works with Jest and TypeScript. The repository describes itself as: Lightweight HTML5 video/audio player with smooth controls and ability to play VAST/VMAP/SIMID/OMID/non-linear ads. The licence is MIT.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit c26914a. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pnpmgitFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pnpm and git, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Write Tests loads about 1.8k tokens when it runs. Until then it costs about 87 tokens; SKILL.md has 657 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from openplayerjs/openplayerjs at commit c26914a, republished under its MIT licence (© openplayerjs). 657 words, ~1,804 tokens.
.claude/skills/write-tests/SKILL.md (or your agent's skills folder).Tests here are the executable spec and are lint-clean (zero no-explicit-any warnings in
__tests__/ — a state that took a 394-warning sweep to reach; do not regress it). Follow
this playbook exactly.
git stash the fix if needed), then confirm it passes after.pnpm run test 2>/dev/null | tail -40 # per-file summary
# then open coverage/lcov-report/<pkg>/<file>.html or:
pnpm exec jest packages/<pkg> --coverage --collectCoverageFrom='packages/<pkg>/src/**'umd.ts, index.ts barrels, and the
documented-unreachable CSAI paths (SIMID/OMID/real-browser HLS) — don't burn time there.packages/<pkg>/__tests__/. Naming: feature.test.ts for main coverage,
feature.branches.test.ts for edge/error paths, scenario-named files for specific
behaviors (player.autoplay.unmute.test.ts)./** @jest-environment jsdom */
import { Core } from '@openplayerjs/core'; // always the package alias, never relative
describe('Feature name', () => {
function makeCore() {
const v = document.createElement('video');
v.src = 'https://example.com/video.mp4';
document.body.appendChild(v);
return new Core(v, { plugins: [] }); // explicit empty plugins — no accidental engines
}
function nn<T>(v: T | null | undefined): T {
expect(v).toBeTruthy();
return v as T;
}
beforeEach(() => {
document.body.innerHTML = '';
});
});No module-level mutable state. Anything shared goes inside the describe as a factory.
Readiness / playback state (mediaMocks from __tests__/setup/mediaMocks.ts is already
loaded globally — play/pause/load/canPlayType are mocked):
p.events.emit('loadedmetadata'); // resolves whenReady()
p.events.emit('playing'); // drive state transitionsSynchronous play/pause for UI tests:
p.play = jest.fn(async () => { p.events.emit('playing'); }) as unknown as Core['play'];
p.pause = jest.fn(() => { p.emit('cmd:pause'); p.events.emit('pause'); }) as unknown as Core['pause'];Read-only media properties — always defineProperty, always configurable:
Object.defineProperty(p.media, 'duration', { value: 120, configurable: true });
Object.defineProperty(p.media, 'paused', { value: false, configurable: true });Timers: jest.useFakeTimers() at the top of the describe; drive with
jest.advanceTimersByTime(ms); flush microtask-based logic with await Promise.resolve().
Never a real setTimeout wait.
jsdom quirks: patch window.scrollX/scrollY (the source reads these, not
pageXOffset); queueMicrotask-based focus handlers need a microtask flush, not a timer.
as any (mandatory)| Need | Pattern |
|---|---|
@internal getters on a plugin | type AdsPluginInternals = AdsPlugin & { bus: NonNullable<AdsPlugin['bus']>; active: boolean }; then as unknown as AdsPluginInternals. @internal methods are public — call them directly, no cast. |
private members | as unknown as { member: T } — an intersection Class & { privateMember } reduces to never; the double cast is the only way. |
| Partial mock context | const ctx = {...} as unknown as PluginContext; — and keep on: a single non-overloaded impl so contextual typing works. |
| Window/global stubs | One local shape per file: const win = window as unknown as { YT?: { Player: jest.Mock } }; assign/delete through it. |
| Custom cue props | type RawCue = TextTrackCue & { data?: ArrayBuffer; value?: unknown; scte35Out?: string }; |
| Vendor DOM APIs | type VendorElement = HTMLElement & { webkitEnterFullscreen?: () => void }; |
| Config extras | Cast to the real config type: { plugins: [], step: 10 } as PlayerUIConfig — never as any. |
| Wrong-type mock returns | mockResolvedValue(undefined as unknown as boolean) when the signature demands it. |
ads — never import @dailymotion/vast-client or @dailymotion/vmap; jest's
moduleNameMapper routes them to packages/ads/__tests__/mocks/ (the mocks export shared
jest.fn() instances — reset them in beforeEach). VAST XML fixtures live in
packages/ads/__tests__/fixtures/ads/*.xml; add a fixture rather than inlining XML. Break
configs passed to typed methods need an explicit annotation
(const brk: AdsBreakConfig = { at: 0, source: { type: 'VAST', … } }) or the type literal
widens to string.
hls — mock event names as constants OUTSIDE the jest.mock() factory
(const E = { MANIFEST_PARSED: 'MANIFEST_PARSED' } as const); get the mock instance via
engine.getAdapter<HlsMockWithEmit>() and adapter!.emit(E.MANIFEST_PARSED, null, {}).
Keep .on/.emit as method calls on the cast object so this stays bound.
youtube / iframe — stub the adapter, not the network: a StubAdapter implements IframeMediaAdapter with a Map<string, Function> listener registry and jest.fn methods;
fake the API global via a typed window handle (win.YT = { Player: jest.fn(...) }).
player controls — build through the real factory, drive with dispatched DOM events
(el.dispatchEvent(new KeyboardEvent('keydown', { key: 'f' }))), and assert on DOM state +
emitted player events, not on private fields, unless a private is the only observable.
toEqual({ id: 'brk-1', kind: 'preroll' })), not
toHaveBeenCalled() alone.test() with a name that
states the behavior ("does not resume content between waterfall attempts"), not the
implementation ("calls startBreak with flag").pnpm exec jest packages/<pkg>/__tests__/<file>.test.ts # the new file, fast loop
pnpm run test # full suite + 85% coverage gates
pnpm run lint # zero new warnings, incl. no-explicit-any
pnpm run type-checkA test that passes but emits lint warnings or needs as any is not done. A suite that hangs
or times out after your change usually means you removed/renamed an event a test subscribes
to — grep the event name across packages/ before anything else.
© openplayerjs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/write-tests of openplayerjs/openplayerjs.
Open the folder on GitHubat commit c26914a
Write Tests next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Write Tests this skillopenplayerjs/openplayerjs | 649 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Write Testsgrafana/synthetic-monitoring-app | 171 | — | ~1.2k | Automated safety check: Pass | AGPL-3.0 | |
| Test Specialisttravisjneuman/.claude | 101 | — | ~3.7k | Automated safety check: Pass | MIT | |
| Senior QAalirezarezvani/claude-skills | 28k | 1 repos | ~2.1k | Automated safety check: Pass | MIT | |
| Test Specialistailabs-393/ai-labs-claude-skills | 454 | — | ~3.4k | Automated safety check: Pass | MIT | |
| TDD Guidealirezarezvani/claude-skills | 28k | — | ~3.4k | Automated safety check: Pass | MIT |
grafana/synthetic-monitoring-app
Write Jest integration and unit tests for the Grafana Synthetic Monitoring app using React Testing Library, MSW, and src/test helpers.
travisjneuman/.claude
Test-writing patterns for JS/TS, Python, Go, and Rust (unit, integration, E2E, visual regression).
alirezarezvani/claude-skills
Generates unit tests, integration tests, and E2E tests for React/Next.js applications.
ailabs-393/ai-labs-claude-skills
This skill should be used when writing test cases, fixing bugs, analyzing code for potential issues, or improving test coverage for JavaScript/TypeScript applications.
alirezarezvani/claude-skills
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…
microsoft/testfx
Generates and writes new unit tests for any programming language — scaffolds .NET test projects, pytest suites, Vitest/Jest suites, Go test files, and JUnit suites, and configures coverage tooling…
openplayerjs/openplayerjs
Add, rename, change the payload of, or remove a typed player event in OpenPlayerJS.
openplayerjs/openplayerjs
Resolve a pnpm audit (dependency-audit CI job) failure — high/critical CVEs in the dependency tree.
openplayerjs/openplayerjs
Run the full OpenPlayerJS verification gauntlet before committing, opening a PR, or preparing a release.
openplayerjs/openplayerjs
Find and safely apply ONE worthwhile code optimization (reuse, simplification, efficiency, or a dead-weight cleanup) somewhere in packages//src, with new regression tests proving behavior is…
Works with
Categories
Write or extend Jest tests for OpenPlayerJS to this repo's exact conventions — makeCore factories, typed internals handles instead of as any, media property mocking, fake timers, ads/vast mocks, and…. Write Tests is an agent skill from openplayerjs/openplayerjs. Write or extend Jest tests for OpenPlayerJS to this repo's exact conventions — makeCore factories, typed internals handles instead of as any, media property mocking, fake timers, ads/vast mocks, and coverage-gap targeting.
Write Tests fits situations like: asked to add tests; fix the 85% threshold; A bug fix needs its regression test.
Run `npx skills add openplayerjs/openplayerjs --skill write-tests -a claude-code`. Or copy the skill folder (.claude/skills/write-tests in openplayerjs/openplayerjs) into .claude/skills/write-tests in your project. Claude Code loads it when a task matches its description.
Run `npx skills add openplayerjs/openplayerjs --skill write-tests -a codex`. Or copy the skill folder (.claude/skills/write-tests in openplayerjs/openplayerjs) into .agents/skills/write-tests in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add openplayerjs/openplayerjs --skill write-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-tests, .gemini/skills/write-tests, .github/skills/write-tests and .opencode/skills/write-tests in your project.
Going by SKILL.md and its folder, Write Tests needs the command-line tools its instructions call (pnpm and git).
SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Write Tests is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Write Tests: Write Tests (grafana/synthetic-monitoring-app, 171 stars), Test Specialist (travisjneuman/.claude, 101 stars), Senior QA (alirezarezvani/claude-skills, 28k stars) and Test Specialist (ailabs-393/ai-labs-claude-skills, 454 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
openplayerjs (a GitHub organization) maintains it in openplayerjs/openplayerjs, which has 649 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 5, 2026.
Source: openplayerjs/openplayerjs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.