From 5ad559d609dc3fd2fb20654c12a9cdba919dbcd0 Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Mon, 22 Jul 2024 19:07:04 +0200 Subject: [PATCH] Add test --- sidekick_core/test/format_command_test.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sidekick_core/test/format_command_test.dart b/sidekick_core/test/format_command_test.dart index e4239fd7..d61808b5 100644 --- a/sidekick_core/test/format_command_test.dart +++ b/sidekick_core/test/format_command_test.dart @@ -128,6 +128,11 @@ name: moshi final runner = initializeSidekick( dartSdkPath: systemDartSdkPath(), ); + + SdkInitializerContext? sdkInitializerContext; + addSdkInitializer((context) { + sdkInitializerContext = context; + }); runner.addCommand(FormatCommand()); await runner.run(['format', '-p', 'moshi']); @@ -136,6 +141,11 @@ name: moshi _dartFile140, ); expect(dir.file('moshi/lib/main.dart').readAsStringSync(), _dartFile80); + expect(sdkInitializerContext!.packageDir!.name, 'moshi'); + expect( + sdkInitializerContext!.workingDirectory!.path, + dir.directory('moshi').path, + ); }); });