Skip to content

Commit

Permalink
Always reset exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
passsy committed Jun 19, 2024
1 parent 8a96ea1 commit cfffb36
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions sidekick_core/test/analyzer_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';

void main() {
tearDown(() => exitCode = 0);
test('analyze command sets exitCode 1 when command fails', () async {
await insideFakeProjectWithSidekick((dir) async {
dir.file('dash_sidekick.dart').writeAsStringSync('''
Expand Down
1 change: 1 addition & 0 deletions sidekick_core/test/bash_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';

void main() {
tearDown(() => exitCode = 0);
test('bash command receives arguments', () async {
await insideFakeProjectWithSidekick((dir) async {
final runner = initializeSidekick(
Expand Down
1 change: 1 addition & 0 deletions sidekick_core/test/dart_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';

void main() {
tearDown(() => exitCode = 0);
test('dart command works when dartSdkPath is set', () async {
await insideFakeProjectWithSidekick((dir) async {
final runner = initializeSidekick(
Expand Down
2 changes: 2 additions & 0 deletions sidekick_core/test/deps_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';

void main() {
tearDown(() => exitCode = 0);

void setUpPackages(Directory tempDir) {
final packages = [
'foo/a',
Expand Down
1 change: 1 addition & 0 deletions sidekick_core/test/flutter_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:sidekick_test/sidekick_test.dart';
import 'package:test/test.dart';

void main() {
tearDown(() => exitCode = 0);
test('flutter command works when flutterSdkPath is set', () async {
await insideFakeProjectWithSidekick((dir) async {
final runner = initializeSidekick(
Expand Down
2 changes: 2 additions & 0 deletions sidekick_core/test/format_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ void main() {
mainFile.writeAsStringSync(mainContent);
}

tearDown(() => exitCode = 0);

group('getLineLength', () {
late File pubspecYamlFile;
late DartPackage package;
Expand Down

0 comments on commit cfffb36

Please sign in to comment.