Overview

Purpose: Automatically maintains your test specs by analyzing code changes and updating, creating, or deleting tests accordingly. When to use:
  • After modifying existing features to keep tests in sync
  • In Pull Request workflows to automate test maintenance
  • When you’ve added new pages or components
  • After deleting or refactoring code sections
Important notes:
  • Compares against git changes to determine what needs updating
  • Can create new tests, modify existing ones, or delete obsolete tests
  • Saves current state for future --against-last-update comparisons
  • Works with both staged and unstaged changes
  • Intelligent enough to update only relevant test sections

CLI Reference

CommandDescriptionExample
bugster updateUpdate tests based on git changesbugster update
bugster update --update-onlyOnly update existing tests, no new/deletebugster update --update-only
bugster update --suggest-onlyOnly suggest new tests for added filesbugster update --suggest-only
bugster update --delete-onlyOnly delete tests for removed filesbugster update --delete-only

Scope Flags

FlagDescriptionExample
--update-onlyOnly update existing specs, no suggestions or deletes--update-only
--suggest-onlyOnly suggest new specs, no updates or deletes--suggest-only
--delete-onlyOnly delete specs, no updates or suggestions--delete-only

Comparison Flags

FlagDescriptionExample
--against-defaultCompare against the default branch instead of HEAD--against-default
--against-last-updateCompare against the commit from the last update run--against-last-update
--show-logsShow detailed logs during analysis (deprecated, use —debug)--show-logs

What Gets Updated

Change TypeActionExample
Modified filesUpdates existing test specsFunction signature changes → updated test steps
New filesSuggests new test specsNew component → generates new test file
Deleted filesRemoves obsolete test specsRemoved page → deletes corresponding tests
Renamed filesUpdates file referencesMoved component → updates import paths

Common Usage Patterns

Use CaseCommandDescription
Full maintenancebugster updateHandle all types of changes
Safe updates onlybugster update --update-onlyOnly modify existing tests
New feature testingbugster update --suggest-onlyGenerate tests for new code
Cleanup after refactorbugster update --delete-onlyRemove obsolete tests
Branch comparisonbugster update --against-defaultCompare against main/master branch
Incremental updatesbugster update --against-last-updateOnly changes since last update

Workflow Integration

ScenarioCommandWhen to Use
Pre-commit hookbugster update --update-onlyBefore committing changes
PR automationbugster update --against-defaultIn GitHub Actions/CI
Feature branchbugster updateAfter completing feature development
Refactoringbugster update --delete-onlyAfter removing old code
Daily maintenancebugster update --against-last-updateRegular test maintenance
Pro Tips:
  • Use --against-last-update for incremental updates in active development
  • --against-default is perfect for PR workflows to catch all branch changes
  • Combine with bugster run --only-affected for complete change validation
  • Update state is automatically saved after successful runs
  • Review suggested changes before committing updated test specs
Important Notes:
  • Cannot use both --against-default and --against-last-update simultaneously
  • Requires git repository with committed changes for comparison
  • Always review generated changes before committing to repository