Skip to content

Add integration tests for withSpinner state restoration #14

@jdalton

Description

@jdalton

Description

10 integration tests for withSpinner and withSpinnerSync state restoration are currently marked as .todo() because they require full logger context which isn't available in the unit test environment.

Location

test/spinner.test.ts:20-230

Tests Needed

withSpinner (6 tests):

  • Restore color after operation
  • Restore color with named colors
  • Restore shimmer state after operation
  • Disable shimmer if it was disabled before
  • Work without withOptions
  • Restore state even if operation throws

withSpinnerSync (4 tests):

  • Same patterns as above, sync versions

Root Cause

These tests call spinner.start() internally, which depends on logger internals (Symbol(logger.lastWasBlank)) that aren't properly initialized in unit tests.

Solution

Set up proper integration test infrastructure with:

  • Full logger context initialization
  • Proper stdout/stderr handling
  • Complete spinner lifecycle support

Current Status

  • Tests exist but marked as .todo()
  • Core spinner functionality is tested (basic tests pass)
  • State restoration feature untested
  • Test output shows: 4546 passed | 3 skipped | 10 todo

Priority

Low - Core functionality works, this is testing edge cases of state restoration in wrapper functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions