Skip to content

Commit

Permalink
Fix(tests): Reset repository in afterAll hook
Browse files Browse the repository at this point in the history
- Use 'git reset HEAD^' command to reset repository
- Use 'git checkout -- .' command to discard changes
- Add 'tests/Fixtures/repository/' to git staging area
  • Loading branch information
ityaozm@gmail.com committed Nov 8, 2023
1 parent 2b14455 commit 1ebdf84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/Feature/CommitCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@

afterAll(static function (): void {
// 清理 playground 仓库
Process::fromShellCommandline('git reset b7a6f28', repository_path())->run();
Process::fromShellCommandline('git reset HEAD^', repository_path())->run();
Process::fromShellCommandline('git checkout -- .', repository_path())->run();
Process::fromShellCommandline('git add tests/Fixtures/repository/', base_path())->mustRun();
});
2 changes: 1 addition & 1 deletion tests/Fixtures/repository
Submodule repository updated from b7a6f2 to 8828cb

0 comments on commit 1ebdf84

Please sign in to comment.