mirror of
				https://github.com/actions-rs/toolchain.git
				synced 2025-10-31 16:53:53 +00:00 
			
		
		
		
	Add test for toml, fix bug returning wrong type
This commit is contained in:
		
							parent
							
								
									4fdb216e18
								
							
						
					
					
						commit
						6bbb331ffc
					
				| @ -71,4 +71,17 @@ describe("actions-rs/toolchain", () => { | ||||
| 
 | ||||
|         expect(args.name).toBe("1.39.0"); | ||||
|     }); | ||||
| 
 | ||||
|     it("supports toml override file", function () { | ||||
|         const rustToolchainFile = tempWriteSync(` | ||||
|             [toolchain] | ||||
|             channel = "stable" | ||||
|         `);
 | ||||
| 
 | ||||
|         const args = morph(() => { | ||||
|             return getToolchainArgs(rustToolchainFile); | ||||
|         }, {}); | ||||
| 
 | ||||
|         expect(args.name).toBe("stable"); | ||||
|     }); | ||||
| }); | ||||
|  | ||||
							
								
								
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -46,9 +46,9 @@ function determineToolchain(overrideFile: string): string { | ||||
|         throw new Error(`channel is not specified in ${toolchainPath}`); | ||||
|     } | ||||
| 
 | ||||
|     debug(`using toolchain from rust-toolchain file: ${rustToolchainFile}`); | ||||
|     debug(`using toolchain from rust-toolchain file: ${toolchain}`); | ||||
| 
 | ||||
|     return rustToolchainFile; | ||||
|     return toolchain; | ||||
| } | ||||
| 
 | ||||
| export function getToolchainArgs(overrideFile: string): ToolchainOptions { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user