From 3ad4166f23d6562aab37b3a3407c499df4a86ed6 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 4 Oct 2024 12:08:41 -0700 Subject: [PATCH] feat: add a longer no-op message. (#218) This is a common source of confusion, hopefully this will help. --- .../lib/src/shorebird_code_push_noop.dart | 3 +++ .../test/shorebird_code_push_io_test.dart | 12 ++++++++++-- .../test/src/shorebird_code_push_noop_test.dart | 4 +++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/shorebird_code_push/lib/src/shorebird_code_push_noop.dart b/shorebird_code_push/lib/src/shorebird_code_push_noop.dart index 923bea0..a94acb5 100644 --- a/shorebird_code_push/lib/src/shorebird_code_push_noop.dart +++ b/shorebird_code_push/lib/src/shorebird_code_push_noop.dart @@ -11,6 +11,9 @@ class ShorebirdCodePushNoop implements ShorebirdCodePushBase { // ignore: avoid_print print(''' [ShorebirdCodePush]: Shorebird Engine not available, using no-op implementation. +This occurs when using package:shorebird_code_push in an app that does not +contain the Shorebird Engine. Most commonly this is due to building with +`flutter build` or `flutter run` instead of `shorebird release`. '''); } @override diff --git a/shorebird_code_push/test/shorebird_code_push_io_test.dart b/shorebird_code_push/test/shorebird_code_push_io_test.dart index e77cb36..559d8a3 100644 --- a/shorebird_code_push/test/shorebird_code_push_io_test.dart +++ b/shorebird_code_push/test/shorebird_code_push_io_test.dart @@ -37,7 +37,11 @@ void main() { printLogs, equals( [ - '''[ShorebirdCodePush]: Shorebird Engine not available, using no-op implementation.\n''', + ''' +[ShorebirdCodePush]: Shorebird Engine not available, using no-op implementation. +This occurs when using package:shorebird_code_push in an app that does not +contain the Shorebird Engine. Most commonly this is due to building with +`flutter build` or `flutter run` instead of `shorebird release`.\n''', ], ), ); @@ -57,7 +61,11 @@ void main() { printLogs, equals( [ - '''[ShorebirdCodePush]: Shorebird Engine not available, using no-op implementation.\n''', + ''' +[ShorebirdCodePush]: Shorebird Engine not available, using no-op implementation. +This occurs when using package:shorebird_code_push in an app that does not +contain the Shorebird Engine. Most commonly this is due to building with +`flutter build` or `flutter run` instead of `shorebird release`.\n''', ], ), ); diff --git a/shorebird_code_push/test/src/shorebird_code_push_noop_test.dart b/shorebird_code_push/test/src/shorebird_code_push_noop_test.dart index 7fc409b..04c98c4 100644 --- a/shorebird_code_push/test/src/shorebird_code_push_noop_test.dart +++ b/shorebird_code_push/test/src/shorebird_code_push_noop_test.dart @@ -23,7 +23,9 @@ void main() { test('logs warning when instantiated', () { const expected = ''' [ShorebirdCodePush]: Shorebird Engine not available, using no-op implementation. -'''; +This occurs when using package:shorebird_code_push in an app that does not +contain the Shorebird Engine. Most commonly this is due to building with +`flutter build` or `flutter run` instead of `shorebird release`.\n'''; expect(printLogs, equals([expected])); });