skills/dev-utils-skills/test-writer/SKILL.md
Generates unit, integration, and end-to-end tests using frameworks like pytest, Jest, JUnit, and Playwright. Use when the user needs to write tests for existing code, create test suites for a module, add edge-case coverage, or set up a testing framework from scratch.
npx skillsauth add partme-ai/full-stack-skills test-writerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill whenever the user wants to:
import pytest
from decimal import Decimal
from orders import calculate_order_total, OrderItem
class TestCalculateOrderTotal:
def test_single_item_no_discount(self):
items = [OrderItem(price=Decimal("10.00"), quantity=2)]
result = calculate_order_total(items, discount_pct=0.0, tax_rate=0.08)
assert result == Decimal("21.60")
def test_applies_discount_before_tax(self):
items = [OrderItem(price=Decimal("100.00"), quantity=1)]
result = calculate_order_total(items, discount_pct=0.1, tax_rate=0.10)
assert result == Decimal("99.00")
def test_empty_items_returns_zero(self):
result = calculate_order_total([], discount_pct=0.0, tax_rate=0.08)
assert result == Decimal("0.00")
def test_invalid_discount_raises_error(self):
items = [OrderItem(price=Decimal("10.00"), quantity=1)]
with pytest.raises(ValueError, match="discount_pct must be 0-1"):
calculate_order_total(items, discount_pct=1.5)
import request from 'supertest';
import { app } from '../src/app';
import { db } from '../src/database';
describe('POST /api/users', () => {
afterEach(async () => { await db.query('DELETE FROM users WHERE email LIKE $1', ['%@test.com']); });
it('creates a user and returns 201', async () => {
const res = await request(app)
.post('/api/users')
.send({ name: 'Alice', email: '[email protected]' })
.expect(201);
expect(res.body).toMatchObject({ name: 'Alice', email: '[email protected]' });
});
it('returns 400 for missing email', async () => {
await request(app).post('/api/users').send({ name: 'Bob' }).expect(400);
});
});
test_<behavior>_when_<condition> or it('should <outcome> when <input>')测试编写, test writing, unit test, integration test, e2e test, pytest, Jest, JUnit, Vitest, Playwright, mock, fixture, 单元测试, 集成测试, 端到端测试, test coverage
development
Provides per-component and per-API examples with cross-platform compatibility details for uni-app, covering built-in components, uni-ui components, and APIs (network, storage, device, UI, navigation, media). Use when the user needs official uni-app components or APIs, wants per-component examples with doc links, or needs platform compatibility checks.
tools
Creates new uni-app projects via the official CLI or HBuilderX with Vue 2/Vue 3 template selection, manifest.json and pages.json configuration, and directory structure setup. Use when the user wants to scaffold a new uni-app project, initialize project files with a single command, or set up the development environment.
tools
Browses, installs, configures, and manages plugins from the uni-app plugin market (ext.dcloud.net.cn) including component plugins, API plugins, and template plugins with dependency handling. Use when the user needs to find and install uni-app plugins, configure plugin settings, manage plugin dependencies, or integrate third-party components.
tools
Develops native Android and iOS plugins for uni-app including module creation, JavaScript-to-native communication, and plugin packaging for distribution. Use when the user needs to build custom native modules, extend uni-app with native capabilities (camera, Bluetooth, sensors), or create publishable native plugins.