Creates test fixtures, mock data, and test scenarios for unit and integration tests. Use when setting up test data, creating mocks, or generating test fixtures.
View on GitHubarmanzeroeight/fastagent-plugins
testing-toolkit
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/armanzeroeight/fastagent-plugins/blob/main/plugins/testing-toolkit/skills/test-data-generator/SKILL.md -a claude-code --skill test-data-generatorInstallation paths:
.claude/skills/test-data-generator/# Test Data Generator
Generate test data, fixtures, and mocks for testing.
## Quick Start
Create a simple fixture:
```javascript
const mockUser = {
id: 1,
name: 'Test User',
email: 'test@example.com'
}
```
## Instructions
### Factory Functions
Create reusable data generators:
```javascript
function createUser(overrides = {}) {
return {
id: Math.floor(Math.random() * 1000),
name: 'Test User',
email: 'test@example.com',
role: 'user',
createdAt: new Date().toISOString(),
...overrides
}
}
// Usage
const admin = createUser({ role: 'admin', name: 'Admin User' })
const regularUser = createUser()
```
```python
def create_user(**kwargs):
defaults = {
'id': random.randint(1, 1000),
'name': 'Test User',
'email': 'test@example.com',
'role': 'user',
'created_at': datetime.now()
}
return {**defaults, **kwargs}
# Usage
admin = create_user(role='admin', name='Admin User')
```
### Builder Pattern
For complex objects:
```javascript
class UserBuilder {
constructor() {
this.user = {
id: 1,
name: 'Test User',
email: 'test@example.com',
role: 'user',
preferences: {}
}
}
withId(id) {
this.user.id = id
return this
}
withName(name) {
this.user.name = name
return this
}
withRole(role) {
this.user.role = role
return this
}
withPreferences(preferences) {
this.user.preferences = preferences
return this
}
build() {
return this.user
}
}
// Usage
const user = new UserBuilder()
.withId(123)
.withName('John Doe')
.withRole('admin')
.withPreferences({ theme: 'dark' })
.build()
```
### Test Fixtures
**JavaScript/TypeScript**:
```javascript
// fixtures/users.js
export const users = {
admin: {
id: 1,
name: 'Admin User',
email: 'admin@example.com',
role: 'admin'
},
regular: {
id: 2,
name: 'Regular User',
email: 'user@example.com',
role: 'user'