mirror of
https://github.com/threeal/cmake-action.git
synced 2026-02-02 03:50:55 +00:00
test: strict TypeScript ESLint configuration (#744)
* test: enable strict TypeScript ESLint configuration Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com> * test: convert ESLint configuration to TypeScript Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com> --------- Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
This commit is contained in:
@@ -183,7 +183,7 @@ describe("get action context", () => {
|
||||
const { getInput } = await import("gha-utils");
|
||||
const { getContext } = await import("./context.js");
|
||||
|
||||
const inputs = testCase.inputs || {};
|
||||
const inputs = testCase.inputs ?? {};
|
||||
vi.mocked(getInput).mockImplementation((name) => inputs[name] ?? "");
|
||||
|
||||
expect(getContext()).toStrictEqual({
|
||||
|
||||
@@ -17,11 +17,11 @@ export async function exec(command: string, args: string[]): Promise<void> {
|
||||
});
|
||||
logCommand(proc.spawnfile, ...proc.spawnargs.splice(1));
|
||||
proc.on("error", reject);
|
||||
proc.on("close", (code) => {
|
||||
proc.on("close", (code: number) => {
|
||||
if (code === 0) {
|
||||
resolve();
|
||||
} else {
|
||||
reject(new Error(`Command exited with status code ${code}`));
|
||||
reject(new Error(`Command exited with status code ${code.toString()}`));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ export function parse(str: string): string[] {
|
||||
const args: string[] = [];
|
||||
let match: RegExpExecArray | null;
|
||||
while ((match = regex.exec(str)) !== null) {
|
||||
args.push(match[1] ?? match[2] ?? match[3] ?? match[4]);
|
||||
args.push(match[1] || match[2] || match[3] || match[4]);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user