Skip to content

Commit a6e7666

Browse files
authored
feat(testing): Auth.fake(), Cache.fake(), Vault.fake(), Log.fake() — facade faking ecosystem (#19) (#23)
Add Laravel-style fake()/unfake() to Auth, Cache, Vault, Log facades following the Http.fake() pattern from #18. Each fake replaces the IoC-bound service with an in-memory test double that records operations and supports assertion methods — no mockito needed. - FakeAuthManager with internal FakeGuard (login/logout/check/user) - FakeCacheManager with in-memory CacheStore (get/put/has/forget/flush) - FakeVaultService with in-memory secure storage (no FlutterSecureStorage) - FakeLogManager with silent log capture (all RFC 5424 levels) - Auth facade refactored from direct singleton to IoC resolution - AuthManager.forTesting() + MagicVaultService.forTesting() constructors - 130 new tests, 649 total passing
1 parent 905a5a8 commit a6e7666

21 files changed

Lines changed: 2689 additions & 2 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
66

77
### ✨ Features
88
- **Http Faking**: `Http.fake()` enables Laravel-style HTTP faking for testing. Swap the real network driver with a `FakeNetworkDriver` that records requests and returns stubbed responses. Supports URL pattern stubs, callback stubs, and assertion methods (`assertSent`, `assertNotSent`, `assertNothingSent`, `assertSentCount`). (#18)
9+
- **Facade Faking**: `Auth.fake()`, `Cache.fake()`, `Vault.fake()`, `Log.fake()` — Laravel-style facade faking for testing. Swap real service implementations with in-memory fakes that record operations and expose assertion helpers. (#19)
910

1011
## [1.0.0-alpha.5] - 2026-03-29
1112

0 commit comments

Comments
 (0)