CLI TestQubit
Tudo que voce precisa para gerar testes automaticamente
Instalacao
# Scaffold completo (recomendado)
npm create testqubit@latest meu-projeto
cd meu-projeto
# Ou instale globalmente
npm i -g testqubitAutenticacao
O plano gratuito permite 50 testes por mes. Faca login para liberar:
# Login (gratuito)
testqubit auth login
# Verificar status
testqubit auth status
# Logout
testqubit auth logoutLLM Providers
TestQubit suporta 8 providers de IA. Configure via variaveis de ambiente:
| Provider | Variavel |
|---|---|
| OpenAI | OPENAI_API_KEY |
| Anthropic | ANTHROPIC_API_KEY |
| Google Gemini | GEMINI_API_KEY |
| DeepSeek | DEEPSEEK_API_KEY |
| Groq | GROQ_API_KEY |
| Cerebras | CEREBRAS_API_KEY |
| Z.AI (GLM) | ZAI_API_KEY |
| Ollama (Local) | none (localhost:11434) |
# .env ou export
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
# Escolher provider ativo
testqubit config set provider openai
# Ollama local (gratuito, sem API key)
ollama serve # em outro terminal
testqubit config set provider ollamaComandos Principais
$ npm create testqubit@latest meu-projetoCria projeto completo com config, exemplos e CI$ npm i -g testqubitInstala a CLI globalmente$ testqubit auth loginAutentica (gratuito, sem cartao)$ testqubit generate src/Gera testes para todos os arquivos em src/$ testqubit generate src/ --watchModo watch: regenera testes ao salvar arquivos$ testqubit generate src/ --framework vitestEspecifica o framework de teste$ testqubit heal src/Corrige testes quebrados automaticamente$ testqubit mutationRoda mutation testing (Stryker) nos testes gerados$ testqubit ci --githubGera workflow do GitHub Actions com TestQubit$ testqubit config initInicializa arquivo de configuracao (.testqubitrc)Linguagens e Frameworks
| Linguagem | Frameworks |
|---|---|
| JavaScript/TypeScript | Jest, Vitest, Playwright, Cypress |
| Python | Pytest |
| Go | go test |
| Rust | cargo test |
| Java | JUnit |
| C# | NUnit |
| Ruby | RSpec |
| PHP | PHPUnit |
Mutation Testing
TestQubit integra Stryker para mutation testing. Mutantes que sobrevivem indicam testes fracos.
# Rodar mutation testing nos testes gerados
testqubit mutation
# Com threshold customizado
testqubit mutation --threshold 90
# Output HTML
testqubit mutation --report html -o reports/mutation/Integracao CI/CD
Gere workflows prontos para commit:
# GitHub Actions
testqubit ci --github
# GitLab CI
testqubit ci --gitlab
# Azure Pipelines
testqubit ci --azure