mirror of
https://github.com/actions/checkout.git
synced 2025-08-15 02:25:11 +00:00
update tests
This commit is contained in:
parent
caa5717450
commit
215f9562a1
@ -814,6 +814,7 @@ async function setup(testName: string): Promise<void> {
|
|||||||
submodules: false,
|
submodules: false,
|
||||||
nestedSubmodules: false,
|
nestedSubmodules: false,
|
||||||
persistCredentials: true,
|
persistCredentials: true,
|
||||||
|
preserveLocalChanges: false,
|
||||||
ref: 'refs/heads/main',
|
ref: 'refs/heads/main',
|
||||||
repositoryName: 'my-repo',
|
repositoryName: 'my-repo',
|
||||||
repositoryOwner: 'my-org',
|
repositoryOwner: 'my-org',
|
||||||
|
@ -143,12 +143,13 @@ describe('git-directory-helper tests', () => {
|
|||||||
repositoryPath,
|
repositoryPath,
|
||||||
repositoryUrl,
|
repositoryUrl,
|
||||||
clean,
|
clean,
|
||||||
ref
|
ref,
|
||||||
|
false // preserveLocalChanges = false
|
||||||
)
|
)
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
const files = await fs.promises.readdir(repositoryPath)
|
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.tryClean).toHaveBeenCalled()
|
||||||
expect(core.warning).toHaveBeenCalled()
|
expect(core.warning).toHaveBeenCalled()
|
||||||
expect(git.tryReset).not.toHaveBeenCalled()
|
expect(git.tryReset).not.toHaveBeenCalled()
|
||||||
@ -170,12 +171,13 @@ describe('git-directory-helper tests', () => {
|
|||||||
repositoryPath,
|
repositoryPath,
|
||||||
differentRepositoryUrl,
|
differentRepositoryUrl,
|
||||||
clean,
|
clean,
|
||||||
ref
|
ref,
|
||||||
|
false // preserveLocalChanges = false
|
||||||
)
|
)
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
const files = await fs.promises.readdir(repositoryPath)
|
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(core.warning).not.toHaveBeenCalled()
|
||||||
expect(git.isDetached).not.toHaveBeenCalled()
|
expect(git.isDetached).not.toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
@ -221,12 +223,13 @@ describe('git-directory-helper tests', () => {
|
|||||||
repositoryPath,
|
repositoryPath,
|
||||||
repositoryUrl,
|
repositoryUrl,
|
||||||
clean,
|
clean,
|
||||||
ref
|
ref,
|
||||||
|
false // preserveLocalChanges = false
|
||||||
)
|
)
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
const files = await fs.promises.readdir(repositoryPath)
|
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.tryClean).toHaveBeenCalled()
|
||||||
expect(git.tryReset).toHaveBeenCalled()
|
expect(git.tryReset).toHaveBeenCalled()
|
||||||
expect(core.warning).toHaveBeenCalled()
|
expect(core.warning).toHaveBeenCalled()
|
||||||
@ -246,12 +249,13 @@ describe('git-directory-helper tests', () => {
|
|||||||
repositoryPath,
|
repositoryPath,
|
||||||
repositoryUrl,
|
repositoryUrl,
|
||||||
clean,
|
clean,
|
||||||
ref
|
ref,
|
||||||
|
false // preserveLocalChanges = false
|
||||||
)
|
)
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
const files = await fs.promises.readdir(repositoryPath)
|
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(core.warning).not.toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -302,12 +306,13 @@ describe('git-directory-helper tests', () => {
|
|||||||
repositoryPath,
|
repositoryPath,
|
||||||
repositoryUrl,
|
repositoryUrl,
|
||||||
clean,
|
clean,
|
||||||
ref
|
ref,
|
||||||
|
false // preserveLocalChanges = false
|
||||||
)
|
)
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
const files = await fs.promises.readdir(repositoryPath)
|
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.tryClean).toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user