1
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2025-08-14 09:20:51 +00:00

update tests

This commit is contained in:
Salman Muin Kayser Chishti 2025-08-11 13:00:43 +01:00
parent caa5717450
commit 215f9562a1
2 changed files with 16 additions and 10 deletions

View file

@ -814,6 +814,7 @@ async function setup(testName: string): Promise<void> {
submodules: false,
nestedSubmodules: false,
persistCredentials: true,
preserveLocalChanges: false,
ref: 'refs/heads/main',
repositoryName: 'my-repo',
repositoryOwner: 'my-org',

View file

@ -143,12 +143,13 @@ describe('git-directory-helper tests', () => {
repositoryPath,
repositoryUrl,
clean,
ref
ref,
false // preserveLocalChanges = false
)
// Assert
const files = await fs.promises.readdir(repositoryPath)
expect(files).toHaveLength(0)
expect(files).toEqual(['.git']) // Expect just the .git directory to remain
expect(git.tryClean).toHaveBeenCalled()
expect(core.warning).toHaveBeenCalled()
expect(git.tryReset).not.toHaveBeenCalled()
@ -170,12 +171,13 @@ describe('git-directory-helper tests', () => {
repositoryPath,
differentRepositoryUrl,
clean,
ref
ref,
false // preserveLocalChanges = false
)
// Assert
const files = await fs.promises.readdir(repositoryPath)
expect(files).toHaveLength(0)
expect(files).toEqual(['.git']) // Expect just the .git directory to remain
expect(core.warning).not.toHaveBeenCalled()
expect(git.isDetached).not.toHaveBeenCalled()
})
@ -221,12 +223,13 @@ describe('git-directory-helper tests', () => {
repositoryPath,
repositoryUrl,
clean,
ref
ref,
false // preserveLocalChanges = false
)
// Assert
const files = await fs.promises.readdir(repositoryPath)
expect(files).toHaveLength(0)
expect(files).toEqual(['.git']) // Expect just the .git directory to remain
expect(git.tryClean).toHaveBeenCalled()
expect(git.tryReset).toHaveBeenCalled()
expect(core.warning).toHaveBeenCalled()
@ -246,12 +249,13 @@ describe('git-directory-helper tests', () => {
repositoryPath,
repositoryUrl,
clean,
ref
ref,
false // preserveLocalChanges = false
)
// Assert
const files = await fs.promises.readdir(repositoryPath)
expect(files).toHaveLength(0)
expect(files).toEqual(['.git']) // Expect just the .git directory to remain
expect(core.warning).not.toHaveBeenCalled()
})
@ -302,12 +306,13 @@ describe('git-directory-helper tests', () => {
repositoryPath,
repositoryUrl,
clean,
ref
ref,
false // preserveLocalChanges = false
)
// Assert
const files = await fs.promises.readdir(repositoryPath)
expect(files).toHaveLength(0)
expect(files).toEqual(['.git']) // Expect just the .git directory to remain
expect(git.tryClean).toHaveBeenCalled()
})