mirror of
				https://git.mirrors.martin98.com/https://github.com/actions/cache
				synced 2025-10-31 18:01:07 +08:00 
			
		
		
		
	Add tests for isGhes
This commit is contained in:
		
							parent
							
								
									2850cd8f45
								
							
						
					
					
						commit
						0f71d4ac9a
					
				| @ -17,6 +17,24 @@ afterEach(() => { | |||||||
|     delete process.env[RefKey]; |     delete process.env[RefKey]; | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | test("isGhes returns true if server url is not github.com", () => { | ||||||
|  |     try { | ||||||
|  |         process.env["GITHUB_SERVER_URL"] = "http://example.com"; | ||||||
|  |         expect(actionUtils.isGhes()).toBe(true); | ||||||
|  |     } finally { | ||||||
|  |         process.env["GITHUB_SERVER_URL"] = undefined; | ||||||
|  |     } | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | test("isGhes returns true when server url is github.com", () => { | ||||||
|  |     try { | ||||||
|  |         process.env["GITHUB_SERVER_URL"] = "http://github.com"; | ||||||
|  |         expect(actionUtils.isGhes()).toBe(false); | ||||||
|  |     } finally { | ||||||
|  |         process.env["GITHUB_SERVER_URL"] = undefined; | ||||||
|  |     } | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| test("isExactKeyMatch with undefined cache key returns false", () => { | test("isExactKeyMatch with undefined cache key returns false", () => { | ||||||
|     const key = "linux-rust"; |     const key = "linux-rust"; | ||||||
|     const cacheKey = undefined; |     const cacheKey = undefined; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Dave Hadka
						Dave Hadka