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 testqubit

Autenticacao

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 logout

LLM Providers

TestQubit suporta 8 providers de IA. Configure via variaveis de ambiente:

ProviderVariavel
OpenAIOPENAI_API_KEY
AnthropicANTHROPIC_API_KEY
Google GeminiGEMINI_API_KEY
DeepSeekDEEPSEEK_API_KEY
GroqGROQ_API_KEY
CerebrasCEREBRAS_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 ollama

Comandos 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

LinguagemFrameworks
JavaScript/TypeScriptJest, Vitest, Playwright, Cypress
PythonPytest
Gogo test
Rustcargo test
JavaJUnit
C#NUnit
RubyRSpec
PHPPHPUnit

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

MCP Server

Integre TestQubit com sua IDE ou agent favorito via Model Context Protocol

MCP Server