extension-test

extension-test is a skill for Claude Code, Codex from quangpl/browser-extension-skills. It costs 37 tokens per session (823 once invoked), scanned A, original, MIT.

Testing guidance for Chrome extensions across three levels: unit tests for isolated code, integration tests for extension interactions, and end-to-end tests in a real Chrome browser. It includes Jest setup, Chrome API mocks, and Puppeteer examples.

In plain words
What is it for?
Use it to configure and run Jest unit or integration tests, mock chrome.* APIs, test React extension interfaces, and run Puppeteer end-to-end tests with the extension loaded.
Why use it?
Chrome extensions depend on browser APIs and cannot be tested like ordinary web pages alone. The guidance separates fast code checks from tests that verify the extension working in Chrome.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to configure and run Jest unit or integration tests, mock chrome.* APIs, test React extension interfaces, and run Puppeteer end-to-end tests with the extension loaded.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/quangpl/browser-extension-skills/extension-test
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add quangpl/browser-extension-skills --skill extension-test
Clone the repo
git clone --depth 1 https://github.com/quangpl/browser-extension-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for extension-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/quangpl/browser-extension-skills/extension-test/github.svg)](https://agentmods.dev/skills/quangpl/browser-extension-skills/extension-test)
Your own site
<a href="https://agentmods.dev/skills/quangpl/browser-extension-skills/extension-test"><img src="https://agentmods.dev/badge/skills/quangpl/browser-extension-skills/extension-test/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for extension-test

Your own site · 80×15
<a href="https://agentmods.dev/skills/quangpl/browser-extension-skills/extension-test"><img src="https://agentmods.dev/badge/skills/quangpl/browser-extension-skills/extension-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 823 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.00823
Opus 5 $0.00018 $0.00411
Sonnet 5 $0.00007 $0.00165
Haiku 4.5 $0.00004 $0.00082

Measured 10d ago against content hash 5e01d4687b51, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

extension-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/extension-test/SKILL.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Extension Testing

Testing Layer Architecture

Unit Tests (Jest)          → Test isolated logic, chrome.* API mocks
Integration Tests (Jest)   → Test service interactions, message passing
E2E Tests (Puppeteer)      → Test in real Chrome with extension loaded

Critical constraint: Extensions CANNOT run in headless mode. E2E requires headless: false or Chrome's --headless=new (Chrome 112+).


Layer 1: Unit + Integration (Jest)

Install

npm install -D jest @types/jest ts-jest jest-chrome
# For React popup:
npm install -D @testing-library/react @testing-library/jest-dom jsdom

jest.config.ts

export default {
  preset: 'ts-jest',
  testEnvironment: 'jsdom',
  setupFilesAfterEnv: ['./jest.setup.ts'],
  moduleNameMapper: {
    '^@/(.*)$': '<rootDir>/src/$1',
  },
};

jest.setup.ts (minimal)

import chrome from 'jest-chrome';
Object.assign(global, { chrome });

Full mock setup → chrome-api-mocks.md Unit/integration patterns → unit-integration-testing.md


Layer 2: E2E (Puppeteer)

Install

npm install -D puppeteer

Launch extension in Chrome

import puppeteer from 'puppeteer';
import path from 'path';

const browser = await puppeteer.launch({
  headless: false,           // extensions require non-headless
  args: [
    `--disable-extensions-except=${path.resolve('dist')}`,
    `--load-extension=${path.resolve('dist')}`,
  ],
});

Get extension ID

const targets = await browser.targets();
const extTarget = targets.find(t => t.type() === 'service_worker');
const extUrl = extTarget?.url() ?? '';
const [, , extId] = extUrl.split('/');

Full E2E patterns → e2e-testing-puppeteer.md


Chrome API Mocking Strategy

API Approach
chrome.storage Mock with in-memory store
chrome.runtime.sendMessage jest.fn() + mock response
chrome.tabs jest.fn() with createMockTab helper
chrome.action jest.fn() stubs
chrome.alarms jest.fn() stubs

Read the full file on GitHub · 127 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 127 lines · 37 tokens per session scan A 5e01d4687b51

Subscribe to this mod's changes

extension-test is a skill published in the GitHub repository quangpl/browser-extension-skills (49 stars, last pushed 3mo ago), licensed MIT. It adds 37 tokens to every session and 823 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

06-test

Write and iterate tests until they pass, or validate a user journey end to end in the browser. Use when the user wants to add coverage, find what's untested, or walk a flow. Not for auditing test health or debugging a failure.

ai-driven-dev/framework · 52 tokens

knowledge-engineering-quality-and-delivery-unit-integration-and-shared-test-harnesses

A testing guide for the CLI and web interfaces, covering unit, integration, end-to-end, and real-process test setup with shared fixtures and cleanup.

echoVic/blade-code · 184 tokens

archestra-dev-testing

Use when deciding whether a change needs a test and at which level — unit, backend route-level integration, MSW-backed frontend integration, or e2e — or when reviewing tests for the "fluff test" anti-pattern. Start here before archestra-dev-backend-tests or archestra-dev-e2e.

archestra-ai/archestra · 68 tokens

browser-qa

Drive a real headless browser against a locally-served web UI and capture screenshot evidence, reporting step-level PASS/FAIL/BLOCKED with extracted DOM text and console errors. Use when a phase on the docker QA image must exercise a rendered UI and attach screenshots — it complements the text-evidence verify/qa-test…

nearform/lastlight · 69 tokens

qa-test

Run an automated QA flow against a CLI or a locally-served app and report step-level pass/fail with evidence. Use when asked to QA-test a feature, exercise a flow end-to-end, or smoke-test what a PR changed.

nearform/lastlight · 51 tokens

vllm-test-generator

A test-writing guide for vLLM, an open-source system for running large language models. It helps create unit, integration, and end-to-end tests that match the project’s existing style.

shen-shanshan/vllm-dev-skills · 135 tokens