mirror of
				https://github.com/threeal/cmake-action.git
				synced 2025-11-04 05:43:42 +00:00 
			
		
		
		
	test: fix get action inputs test when source dir specified
This commit is contained in:
		
							parent
							
								
									5c7d8af23f
								
							
						
					
					
						commit
						d402eb61d6
					
				@ -1,4 +1,5 @@
 | 
				
			|||||||
import { jest } from "@jest/globals";
 | 
					import { jest } from "@jest/globals";
 | 
				
			||||||
 | 
					import path from "node:path";
 | 
				
			||||||
import type { Inputs } from "./inputs.js";
 | 
					import type { Inputs } from "./inputs.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
jest.unstable_mockModule("@actions/core", () => ({
 | 
					jest.unstable_mockModule("@actions/core", () => ({
 | 
				
			||||||
@ -23,13 +24,27 @@ describe("get action inputs", () => {
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
      name: "with source directory specified",
 | 
					      name: "with source directory specified",
 | 
				
			||||||
      stringInputs: { "source-dir": "project" },
 | 
					      stringInputs: { "source-dir": "project" },
 | 
				
			||||||
      expectedInputs: { sourceDir: "project" },
 | 
					      expectedInputs: {
 | 
				
			||||||
 | 
					        sourceDir: "project",
 | 
				
			||||||
 | 
					        buildDir: path.join("project", "build"),
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      name: "with build directory specified",
 | 
					      name: "with build directory specified",
 | 
				
			||||||
      stringInputs: { "build-dir": "output" },
 | 
					      stringInputs: { "build-dir": "output" },
 | 
				
			||||||
      expectedInputs: { buildDir: "output" },
 | 
					      expectedInputs: { buildDir: "output" },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      name: "with source and build directories specified",
 | 
				
			||||||
 | 
					      stringInputs: {
 | 
				
			||||||
 | 
					        "source-dir": "project",
 | 
				
			||||||
 | 
					        "build-dir": "output",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      expectedInputs: {
 | 
				
			||||||
 | 
					        sourceDir: "project",
 | 
				
			||||||
 | 
					        buildDir: "output",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      name: "with generator specified",
 | 
					      name: "with generator specified",
 | 
				
			||||||
      stringInputs: { generator: "Ninja" },
 | 
					      stringInputs: { generator: "Ninja" },
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user