Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
passsy committed Jul 22, 2024
1 parent eb1c969 commit 5ad559d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sidekick_core/test/format_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand All @@ -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,
);
});
});

Expand Down

0 comments on commit 5ad559d

Please sign in to comment.