/chrome-extension-developer:extension-testfrom chrome-extension-developer
Set up and run unit, integration, and E2E tests for Chrome extensions. Covers Jest mocks for chrome.* APIs and Puppeteer E2E with real Chrome.
Ships in chrome-extension-developer. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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+).
npm install -D jest @types/jest ts-jest jest-chrome
# For React popup:
npm install -D @testing-library/react @testing-library/jest-dom jsdom
export default {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['./jest.setup.ts'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
};
import chrome from 'jest-chrome';
Object.assign(global, { chrome });
Full mock setup → chrome-api-mocks.md Unit/integration patterns → unit-integration-testing.md
npm install -D puppeteer
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')}`,
],
});
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
| 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 |
All mocks → chrome-api-mocks.md
{
"scripts": {
"test:unit": "jest --testPathPattern=unit",
"test:integration": "jest --testPathPattern=integration",
"test:e2e": "jest --testPathPattern=e2e --runInBand",
"test": "npm run test:unit && npm run test:integration"
}
}
Run E2E separately (
--runInBand) — Puppeteer tests must run serially.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub andrewr303/claude-codex-plugin-lab --plugin chrome-extension-developer13 skills in this plugin
/chrome-extension-developerUltimate Codex workflow for Google Chrome extension work: Manifest V3, WXT, Plasmo, CRXJS, content scripts, service workers, popup UI, side panel, permissions, testing, security review, payments, assets, and Chrome Web Store publishing./extension-analyzeAudit Chrome extensions for security issues, best practice violations, performance problems, and CWS compliance. Scans manifest, code, CSP, message handlers, storage, and dependencies./extension-assetsGenerate and manage all Chrome extension assets: icons (16–128px), CWS listing images, promotional tiles, and public/ folder setup. Supports ImageMagick, Gemini API, and manual prompt templates./extension-backendBuild backend APIs for Chrome extensions. NestJS + MongoDB (Mongoose) recommended stack. Auth, webhooks, license verification, CORS. Use when: backend, API, server, database, license, webhook./extension-createAuto-scaffold Chrome extensions with WXT or Plasmo. Ask user for name/features, scaffold, configure entrypoints. Use when: create extension, scaffold, new extension./extension-devDetect Chrome extension framework/stack, find proper docs, implement features, and debug across service worker, content script, and popup contexts.