0
1
Fork 0
mirror of https://github.com/actions/checkout synced 2024-06-29 16:28:19 +02:00
checkout/__test__
sminnie bb965fa266 Add 2 test cases for submodule status.
This commit adds tests to verify the behavior of the gitDirectoryHelper.prepareExistingDirectory() function when the submodule status is either true or false.
The test cleanWhenSubmoduleStatusIsFalse verifies that the function will clean the directory when the submodule status is false. The test sets up a mock implementation of git.submoduleStatus to always return false, writes a file to the repository, and then calls gitDirectoryHelper.prepareExistingDirectory(). The test verifies that the directory is cleaned and that git.tryClean() is called.
The test doesNotCleanWhenSubmoduleStatusIsTrue verifies that the function will not clean the directory when the submodule status is true. The test sets up a mock implementation of git.submoduleStatus to always return true, writes a file to the repository, and then calls gitDirectoryHelper.prepareExistingDirectory(). The test verifies that the directory is not cleaned, that the file and .git folder are present, and that git.tryClean() is called.
These tests ensure that the function behaves as expected based on the submodule status.
2023-03-19 17:44:24 -07:00
..
git-auth-helper.test.ts Add mock implementation for new function submoduleStatus 2023-03-02 09:28:25 -08:00
git-command-manager.test.ts Implement branch list using callbacks from exec function (#1045) 2022-12-14 16:08:53 -05:00
git-directory-helper.test.ts Add 2 test cases for submodule status. 2023-03-19 17:44:24 -07:00
git-version.test.ts Convert checkout to a regular action (#70) 2019-12-03 10:28:59 -05:00
input-helper.test.ts Add set-safe-directory input to allow customers to take control. (#770) 2022-04-20 21:37:43 -04:00
modify-work-tree.sh Convert checkout to a regular action (#70) 2019-12-03 10:28:59 -05:00
override-git-version.cmd Swap to Environment Files (#360) 2020-09-30 11:41:09 -04:00
override-git-version.sh Swap to Environment Files (#360) 2020-09-30 11:41:09 -04:00
ref-helper.test.ts update dev dependencies and react to new linting rules (#611) 2021-10-19 09:52:57 -05:00
retry-helper.test.ts update dev dependencies and react to new linting rules (#611) 2021-10-19 09:52:57 -05:00
verify-basic.sh update default branch (#305) 2020-07-14 09:23:30 -04:00
verify-clean.sh Convert checkout to a regular action (#70) 2019-12-03 10:28:59 -05:00
verify-lfs.sh Convert checkout to a regular action (#70) 2019-12-03 10:28:59 -05:00
verify-no-unstaged-changes.sh update troubleshooting instructions to include 'npm run format' 2020-05-31 17:48:51 -04:00
verify-side-by-side.sh Convert checkout to a regular action (#70) 2019-12-03 10:28:59 -05:00
verify-submodules-false.sh add support for submodules (#173) 2020-03-05 14:21:59 -05:00
verify-submodules-recursive.sh add support for submodules (#173) 2020-03-05 14:21:59 -05:00
verify-submodules-true.sh add support for submodules (#173) 2020-03-05 14:21:59 -05:00