.internal-skills/testing-specialist/SKILL.md
Especialista em QA/Testes automatizados. Use para: - Criar estratégia de testes completa - Implementar testes unitários, integração e E2E - TDD/BDD quando aplicável - Coverage analysis - Testes de performance e carga
npx skillsauth add suportebahia/equipe-devs Equipe SBahia - Especialista em TestesInstall 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.
/\
/ \ E2E (10%)
/----\
/ \ Integração (20%)
/--------\
/ \ Unitários (70%)
/____________\
// Jest
describe('UserService', () => {
beforeEach(() => {
jest.clearAllMocks();
});
it('should create user with valid data', async () => {
const mockRepo = {
save: jest.fn().mockResolvedValue({ id: 1, email: '[email protected]' })
};
const service = new UserService(mockRepo);
const user = await service.create({ email: '[email protected]', name: 'Test' });
expect(user.id).toBe(1);
expect(mockRepo.save).toHaveBeenCalledTimes(1);
});
it('should throw validation error for invalid email', async () => {
const service = new UserService(mockRepo);
await expect(
service.create({ email: 'invalid', name: 'Test' })
).rejects.toThrow('Invalid email');
});
});
// Supertest + Jest
describe('POST /api/users', () => {
beforeAll(async () => {
await setupTestDatabase();
});
it('should create user successfully', async () => {
const response = await request(app)
.post('/api/users')
.send({ email: '[email protected]', name: 'Test' })
.expect(201);
expect(response.body).toHaveProperty('id');
expect(response.body.email).toBe('[email protected]');
});
it('should return 400 for invalid data', async () => {
const response = await request(app)
.post('/api/users')
.send({ email: 'invalid' })
.expect(400);
expect(response.body.errors).toBeDefined();
});
});
// Cypress
describe('User Login Flow', () => {
beforeEach(() => {
cy.visit('/login');
});
it('should login with valid credentials', () => {
cy.get('[data-testid="email-input"]').type('[email protected]');
cy.get('[data-testid="password-input"]').type('password123');
cy.get('[data-testid="login-button"]').click();
cy.url().should('include', '/dashboard');
cy.get('[data-testid="user-name"]').should('contain', 'User');
});
it('should show error with invalid credentials', () => {
cy.get('[data-testid="email-input"]').type('[email protected]');
cy.get('[data-testid="password-input"]').type('wrongpass');
cy.get('[data-testid="login-button"]').click();
cy.get('[data-testid="error-message"]')
.should('be.visible')
.and('contain', 'Invalid credentials');
});
});
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '2m', target: 100 }, // Ramp up
{ duration: '5m', target: 100 }, // Steady
{ duration: '2m', target: 0 }, // Ramp down
],
thresholds: {
http_req_duration: ['p(95)<500'], // 95% < 500ms
http_req_failed: ['rate<0.01'], // < 1% errors
},
};
export default function() {
const res = http.get('https://api.example.com/users');
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
});
sleep(1);
}
// Stryker.js config
module.exports = {
packages: ['.'],
strykerConfig: {
jest: {
projectType: 'react',
},
mutator: 'javascript',
reporters: ['html', 'clear-text'],
thresholds: { high: 80, low: 70, break: 60 },
},
};
| Tipo | Mínimo | Ideal | |------|--------|-------| | Unitários | 70% | 80%+ | | Integração | 50% | 60%+ | | E2E | Fluxos críticos | 100% |
# GitHub Actions
name: Test Suite
on: [push, pull_request]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run test:unit -- --coverage
- run: npm run test:mutation
integration-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- run: npm run test:integration
e2e-tests:
runs-on: ubuntu-latest
steps:
- run: npm run dev &
- run: npm run test:e2e
should throw error when email is invalid| Tipo | Ferramenta | |------|------------| | Unit | Jest, Vitest, Mocha | | E2E | Cypress, Playwright | | Integração | Supertest, Pact | | Performance | k6, JMeter, Gatling | | Mutation | Stryker, Pitest | | Snapshot | Jest Snapshot, Chromatic | | Mock | MSW, MirageJS, Nock |
testing
Sistema de agentes IA para coordenação de projetos de desenvolvimento. Use este skill para iniciar qualquer projeto. Este skill orquestra automaticamente os agentes especializados conforme a necessidade: - Análise e planejamento de projetos - Coordenação de múltiplos agentes - Gestão de tasks e dependências
development
Orquestrador principal do ecossistema de agentes IA Equipe SBahia. Use para: - Coordenar projetos de desenvolvimento web - Alocar agentes especializados - Gerenciar workflow completo - Garantir padrões MVC e de mercado Agents disponíveis: leadership-tech, uxui-designer, frontend-developer, backend-controller, backend-model, dba-specialist, security-specialist, api-gateway-specialist, mobile-developer, data-engineer, elastic-engineer, machine-learning-engineer, testing-specialist, error-handling-specialist, product-owner, devops-engineer, solutions-engineer
testing
Skill para Designer UX/UI. Use para: - Criar experiência do usuário - Desenvolver interfaces visuais - Definir design system - Validar usabilidade
testing
Engenheiro de Soluções / Pré-Vendas Técnico. Use para: - Pesquisar mercado e precificar projetos - Desenhar arquiteturas de solução - Estimar effort e custos - Elaborar propostas comerciais - Inteligencia competitiva