mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-31 01:58:36 +08:00 
			
		
		
		
	.
This commit is contained in:
		
							parent
							
								
									6d624b2ee3
								
							
						
					
					
						commit
						950c952658
					
				|  | @ -1,9 +1,9 @@ | ||||||
| import * as assert from 'assert' |  | ||||||
| import * as core from '@actions/core' | import * as core from '@actions/core' | ||||||
| import * as fsHelper from '../lib/fs-helper' | import * as fsHelper from '../lib/fs-helper' | ||||||
| import * as github from '@actions/github' | import * as github from '@actions/github' | ||||||
| import * as inputHelper from '../lib/input-helper' | import * as inputHelper from '../lib/input-helper' | ||||||
| import * as path from 'path' | import * as path from 'path' | ||||||
|  | import * as workflowContextHelper from '../lib/workflow-context-helper' | ||||||
| import {IGitSourceSettings} from '../lib/git-source-settings' | import {IGitSourceSettings} from '../lib/git-source-settings' | ||||||
| 
 | 
 | ||||||
| const originalGitHubWorkspace = process.env['GITHUB_WORKSPACE'] | const originalGitHubWorkspace = process.env['GITHUB_WORKSPACE'] | ||||||
|  | @ -43,6 +43,11 @@ describe('input-helper tests', () => { | ||||||
|       .spyOn(fsHelper, 'directoryExistsSync') |       .spyOn(fsHelper, 'directoryExistsSync') | ||||||
|       .mockImplementation((path: string) => path == gitHubWorkspace) |       .mockImplementation((path: string) => path == gitHubWorkspace) | ||||||
| 
 | 
 | ||||||
|  |     // Mock ./workflowContextHelper getOrganizationId()
 | ||||||
|  |     jest | ||||||
|  |       .spyOn(workflowContextHelper, 'getOrganizationId') | ||||||
|  |       .mockImplementation(() => Promise.resolve(123456)) | ||||||
|  | 
 | ||||||
|     // GitHub workspace
 |     // GitHub workspace
 | ||||||
|     process.env['GITHUB_WORKSPACE'] = gitHubWorkspace |     process.env['GITHUB_WORKSPACE'] = gitHubWorkspace | ||||||
|   }) |   }) | ||||||
|  | @ -128,4 +133,9 @@ describe('input-helper tests', () => { | ||||||
|     expect(settings.ref).toBe('refs/heads/some-other-ref') |     expect(settings.ref).toBe('refs/heads/some-other-ref') | ||||||
|     expect(settings.commit).toBeFalsy() |     expect(settings.commit).toBeFalsy() | ||||||
|   }) |   }) | ||||||
|  | 
 | ||||||
|  |   it('sets workflow organization ID', async () => { | ||||||
|  |     const settings: IGitSourceSettings = await inputHelper.getInputs() | ||||||
|  |     expect(settings.workflowOrganizationId).toBe(123456) | ||||||
|  |   }) | ||||||
| }) | }) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 eric sciple
						eric sciple