Merge remote-tracking branch 'upstream/main' into feature/corepack

This commit is contained in:
Jacob Parish 2025-03-25 09:22:34 -05:00
commit dfc689aeba
48 changed files with 27860 additions and 12127 deletions

View file

@ -2,6 +2,7 @@ import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as tc from '@actions/tool-cache';
import * as cache from '@actions/cache';
import * as io from '@actions/io';
import fs from 'fs';
import path from 'path';
@ -25,6 +26,10 @@ describe('main tests', () => {
let startGroupSpy: jest.SpyInstance;
let endGroupSpy: jest.SpyInstance;
let whichSpy: jest.SpyInstance;
let existsSpy: jest.SpyInstance;
let getExecOutputSpy: jest.SpyInstance;
let getCommandOutputSpy: jest.SpyInstance;
@ -57,6 +62,8 @@ describe('main tests', () => {
inSpy = jest.spyOn(core, 'getInput');
inSpy.mockImplementation(name => inputs[name]);
whichSpy = jest.spyOn(io, 'which');
getExecOutputSpy = jest.spyOn(exec, 'getExecOutput');
getCommandOutputSpy = jest.spyOn(cacheUtil, 'getCommandOutput');
@ -143,6 +150,10 @@ describe('main tests', () => {
return {stdout: obj[command], stderr: '', exitCode: 0};
});
whichSpy.mockImplementation(cmd => {
return `some/${cmd}/path`;
});
await util.printEnvDetailsAndSetOutput();
expect(setOutputSpy).toHaveBeenCalledWith('node-version', obj['node']);