|
75 | 75 | ]); |
76 | 76 | }); |
77 | 77 |
|
78 | | - $this->artisan(CommitCommand::class, [ |
79 | | - 'path' => repository_path(), |
80 | | - '--generator' => 'openai', |
81 | | - ]); |
| 78 | + $this |
| 79 | + ->artisan(CommitCommand::class, [ |
| 80 | + 'path' => repository_path(), |
| 81 | + '--generator' => 'openai', |
| 82 | + ]) |
| 83 | + // ->expectsChoice('Please choice commit type', array_key_first($types = config('ai-commit.types')), $types) |
| 84 | + ->expectsQuestion('Please choice commit type', array_key_first(config('ai-commit.types'))); |
82 | 85 | }) |
83 | 86 | ->depends('it will throw TaskException(no cached files to commit)') |
84 | 87 | ->group(__DIR__, __FILE__) |
|
107 | 110 | $message->keys()->all(), |
108 | 111 | [$message->all()] |
109 | 112 | ) |
| 113 | + // ->expectsChoice('Please choice commit type', array_key_first($types = config('ai-commit.types')), $types) |
| 114 | + ->expectsQuestion('Please choice commit type', array_key_first(config('ai-commit.types'))) |
110 | 115 | // ->expectsChoice('Please choice a commit message', $message->pluck('subject', 'id')->first(), $message->pluck('subject', 'id')->all()) |
111 | 116 | // ->expectsQuestion('Please choice a commit message', '<comment>regenerating...</comment>') |
112 | 117 | ->expectsConfirmation('Do you want to commit this message?', 'yes') |
|
118 | 123 | afterAll(static function (): void { |
119 | 124 | // 清理 playground 仓库 |
120 | 125 | Process::fromShellCommandline('git reset HEAD^', repository_path())->run(); |
121 | | - Process::fromShellCommandline('git checkout -- .', repository_path())->run(); |
| 126 | + // Process::fromShellCommandline('git checkout -- .', repository_path())->run(); |
| 127 | + Process::fromShellCommandline('git checkout HEAD -- .', repository_path())->run(); |
122 | 128 | Process::fromShellCommandline('git add tests/Fixtures/repository/', base_path())->mustRun(); |
123 | 129 | }); |
0 commit comments