golden_test_cached_network_image 1.0.0 copy "golden_test_cached_network_image: ^1.0.0" to clipboard
golden_test_cached_network_image: ^1.0.0 copied to clipboard

Makes CachedNetworkImage work in golden_test golden tests: serves a placeholder from an in-memory cache, with no SQLite or platform channels.

1.0.0 #

Initial release.

  • GoldenTestCacheManager — an in-memory BaseCacheManager that serves the golden_test placeholder image, with no SQLite and no platform channels, so CachedNetworkImage resolves inside Flutter's fake-async test zone instead of hanging. Entries are addressed by cache key, so CachedNetworkImage(cacheKey:) works and FileInfo.originalUrl still reports the URL.
  • setupGoldenTestCachedNetworkImage() — one call in flutter_test_config.dart installs the manager for every golden test.
  • cacheManagerBuilder — optional hook to supply your own BaseCacheManager, built fresh per test so cache state can't leak between them.
2
likes
160
points
73
downloads

Documentation

API reference

Publisher

verified publishergoldentest.dev

Weekly Downloads

Makes CachedNetworkImage work in golden_test golden tests: serves a placeholder from an in-memory cache, with no SQLite or platform channels.

Repository (GitHub)
View/report issues

Topics

#flutter #testing #golden-tests #ui-testing #snapshot-testing

License

BSD-3-Clause (license)

Dependencies

cached_network_image, file, flutter, flutter_cache_manager, golden_test

More

Packages that depend on golden_test_cached_network_image