From d402eb61d647f7d8527c9eb7798c6dcb24dfc9c5 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 25 Mar 2024 11:04:16 +0700 Subject: [PATCH] test: fix get action inputs test when source dir specified --- src/inputs.test.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/inputs.test.ts b/src/inputs.test.ts index 128963c..e56e4c4 100644 --- a/src/inputs.test.ts +++ b/src/inputs.test.ts @@ -1,4 +1,5 @@ import { jest } from "@jest/globals"; +import path from "node:path"; import type { Inputs } from "./inputs.js"; jest.unstable_mockModule("@actions/core", () => ({ @@ -23,13 +24,27 @@ describe("get action inputs", () => { { name: "with source directory specified", stringInputs: { "source-dir": "project" }, - expectedInputs: { sourceDir: "project" }, + expectedInputs: { + sourceDir: "project", + buildDir: path.join("project", "build"), + }, }, { name: "with build directory specified", stringInputs: { "build-dir": "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", stringInputs: { generator: "Ninja" },