testing
Testing patterns for game client and server. Auto-applies when working with tests or implementing features that need testing.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Testing patterns for game client and server. Auto-applies when working with tests or implementing features that need testing.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Animate 3D objects and characters in Blender with Python. Use when the user wants to keyframe properties, create armatures and rigs, set up IK/FK chains, animate shape keys for facial animation, edit F-Curves, use the NLA editor to blend actions, add drivers for expression-based animation, or script any animation workflow in Blender.
Create 3D models procedurally with Blender Python. Use when the user wants to generate meshes from code, build geometry with bmesh, apply modifiers, create parametric shapes, procedural landscapes, grids, curves, or any programmatic 3D modeling in Blender.
Automate Blender compositing and post-processing with Python. Use when the user wants to set up compositor nodes, add post-processing effects, color correct renders, combine render passes, apply blur or glare, key green screens, create node-based VFX pipelines, or script the Blender compositor.
Automate Blender rendering from the command line. Use when the user wants to set up renders, batch render scenes, configure Cycles or EEVEE, set up cameras and lights, render animations, create materials and shaders, or build a render pipeline with Blender Python scripting.
Write and run Blender Python scripts for 3D automation. Use when the user wants to automate Blender tasks, run headless scripts, manipulate scenes, batch process .blend files, import/export 3D models, manage objects, or script Blender from the command line using the bpy API.
MongoDB database exploration for understanding game data, debugging, and investigation. Auto-applies when discussing database structure or debugging data issues.
| name | testing |
| description | Testing patterns for game client and server. Auto-applies when working with tests or implementing features that need testing. |
| allowed-tools | Bash, Read, Write, Edit, Grep, Glob |
Testing patterns for OpenCivilizations game.
client/
__tests__/ # Client-side tests
game/ # Game logic tests
ui/ # UI component tests
server/
__tests__/ # Server-side tests
rooms/ # Room logic tests
mechanics/ # Game mechanics tests
shared/
__tests__/ # Shared utility tests
# All tests
npm test
# Client tests only
npm run test:client
# Server tests only
npm run test:server
# Watch mode
npm run test:watch
# Specific test file
npm test -- path/to/test.spec.ts
import { calculateResources } from '../mechanics/resources';
describe('Resource Calculation', () => {
it('calculates gold production based on time elapsed', () => {
const player = { gold: 0, lastUpdate: Date.now() - 3600000 };
const farms = [{ productionRate: 10 }];
const result = calculateResources(player, farms);
expect(result.gold).toBe(10); // 1 hour * 10/hour
});
});
import { ColyseusTestServer } from '@colyseus/testing';
import { GameRoom } from '../rooms/GameRoom';
describe('GameRoom', () => {
let colyseus: ColyseusTestServer;
beforeAll(async () => {
colyseus = new ColyseusTestServer();
await colyseus.listen(2567);
});
afterAll(() => colyseus.shutdown());
it('creates building when player has resources', async () => {
const room = await colyseus.createRoom('game', {});
const client = await colyseus.connectTo(room);
client.send('build', { type: 'farm', x: 5, y: 5 });
await room.waitForNextPatch();
expect(room.state.buildings.length).toBe(1);
});
});
import { findPath } from '../systems/pathfinding';
describe('Pathfinding', () => {
it('finds path around obstacles', () => {
const grid = createGrid(10, 10);
grid[5][5].walkable = false; // obstacle
const path = findPath(grid, { x: 0, y: 0 }, { x: 9, y: 9 });
expect(path).not.toContain({ x: 5, y: 5 });
expect(path[path.length - 1]).toEqual({ x: 9, y: 9 });
});
});
import { cartesianToIsometric, isometricToCartesian } from '../utils/isometric';
describe('Isometric Conversion', () => {
it('converts cartesian to isometric and back', () => {
const cart = { x: 5, y: 3 };
const iso = cartesianToIsometric(cart.x, cart.y);
const result = isometricToCartesian(iso.x, iso.y);
expect(Math.round(result.x)).toBe(cart.x);
expect(Math.round(result.y)).toBe(cart.y);
});
});
Test scenarios come from story files:
docs/planning/stories/*.story.mdit('denies build when insufficient gold')