mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-31 09:13:36 +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, | ||||
|     nestedSubmodules: false, | ||||
|     persistCredentials: true, | ||||
|     preserveLocalChanges: false, | ||||
|     ref: 'refs/heads/main', | ||||
|     repositoryName: 'my-repo', | ||||
|     repositoryOwner: 'my-org', | ||||
|  | ||||
| @ -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() | ||||
|   }) | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user