Skip to content

Hermetic UserDefaults in tests #12

Description

@0xLeif

From PR #1 review nits.

Tests currently write aps.flag into the real UserDefaults.standard domain of whatever runs them. AppState's userDefaults dependency (SendableUserDefaults) is injectable; swap in an isolated suite (e.g. UserDefaults(suiteName:) per test run) in setUp.

Acceptance criteria

  • Test runs leave zero keys in the standard domain
  • flag round-trip and persistence tests still pass against the injected suite

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    hardeningCorrectness, isolation, or cleanup work

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions