Skip to main content
The bugster update command automatically maintains your test specifications by analyzing code changes and updating, creating, or deleting tests accordingly to keep them synchronized with your evolving codebase.

Basic Usage

Command Overview

Analyzes git changes in your codebase and intelligently updates your test suite to reflect modifications, additions, and deletions in your application code.

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

Key Features

  • Compares against git changes to determine updates needed
  • Creates new tests, modifies existing ones, or deletes obsolete tests
  • Saves current state for future incremental comparisons
  • Works with both staged and unstaged changes
  • Intelligent selective updating of relevant test sections
The update command requires a git repository with committed changes for comparison and automatically saves update state after successful runs.
Automatic test synchronization is currently available for Next.js and React applications. For other frameworks, you can still update tests using coding agents (Cursor or Claude Code) with the plugin rules.

Command Syntax

How It Works

The update command:
  1. Change Analysis: Compares current code against git history or saved state
  2. Impact Assessment: Identifies which tests are affected by code changes
  3. Test Maintenance: Updates, creates, or deletes test specifications as needed
  4. State Saving: Records current state for future incremental updates
  5. Validation: Ensures test specifications remain valid and executable

Update Types

Updates existing test specs when code changes:
  • Function signature changes → updated test steps
  • UI modifications → adjusted interaction flows
  • Logic updates → revised assertion patterns

Scope Options

boolean
Only update existing test specifications. No new test suggestions or deletions will be performed.
boolean
Only suggest new test specifications for added files. No updates to existing tests or deletions.
boolean
Only delete obsolete test specifications for removed files. No updates or new suggestions.

Comparison Options

boolean
Compare against the default branch (main/master) instead of HEAD. Perfect for Pull Request workflows.
boolean
Compare against the commit from the last update run. Enables incremental updates for active development.
boolean
Show detailed logs during analysis. (Deprecated - use —debug instead)

Examples

Complete Test Maintenance

Handles all types of changes: updates, additions, and deletions.

Safe Updates Only

Only modifies existing tests without creating new ones or deleting any.

New Feature Testing

Generates tests only for newly added code and features.

Post-refactor Cleanup

Removes obsolete tests after code refactoring or deletion.

Branch Comparison

Compares against main/master branch to catch all changes in feature branch.

Incremental Updates

Only processes changes since the last update run for efficient maintenance.

Workflow Integration

Pre-commit Hook

Ensure tests stay current before committing changes.

PR Automation

Automate test maintenance in GitHub Actions/CI.

Feature Development

Complete maintenance after feature development.

Daily Maintenance

Regular incremental test maintenance.

Update Scenarios

Maintains tests throughout feature development lifecycle.
Automated test maintenance in CI/CD pipelines.
Systematic test cleanup after code restructuring.

Validation Workflow

After running update, follow this validation process:
  1. Review Changes: Examine generated test modifications
  2. Run Tests: Execute updated tests with bugster run --only-affected
  3. Validate Coverage: Ensure new features have adequate test coverage
  4. Commit Updates: Add updated test specifications to version control

Limitations

Cannot use both --against-default and --against-last-update simultaneously. Choose one comparison method per execution.

Best Practices

Use --against-last-update for incremental updates during active development. Combine with bugster run --only-affected for complete change validation workflow.
Always review generated changes before committing to your repository. The --against-default flag is perfect for PR workflows to catch all branch changes comprehensively.