mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-19 21:04:45 +00:00
Merge remote-tracking branch 'upstream/main' into feature/corepack
This commit is contained in:
commit
dfc689aeba
48 changed files with 27860 additions and 12127 deletions
|
@ -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']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue