mirror of
https://gitea.com/actions/setup-node.git
synced 2025-04-05 06:49:44 +00:00
Add support for arm64 Windows (#927)
* add support for arm64 Windows * revert 7z to exe * add comment --------- Co-authored-by: aparnajyothi-y <147696841+aparnajyothi-y@users.noreply.github.com>
This commit is contained in:
@ -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';
|
||||
@ -24,6 +25,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 getNodeVersionFromFileSpy: jest.SpyInstance;
|
||||
@ -55,6 +60,8 @@ describe('main tests', () => {
|
||||
inSpy = jest.spyOn(core, 'getInput');
|
||||
inSpy.mockImplementation(name => inputs[name]);
|
||||
|
||||
whichSpy = jest.spyOn(io, 'which');
|
||||
|
||||
getExecOutputSpy = jest.spyOn(exec, 'getExecOutput');
|
||||
|
||||
findSpy = jest.spyOn(tc, 'find');
|
||||
@ -140,6 +147,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']);
|
||||
|
@ -248,6 +248,9 @@ describe('setup-node', () => {
|
||||
const toolPath = path.normalize('/cache/node/12.16.2/x64');
|
||||
exSpy.mockImplementation(async () => '/some/other/temp/path');
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
whichSpy.mockImplementation(cmd => {
|
||||
return `some/${cmd}/path`;
|
||||
});
|
||||
|
||||
await main.run();
|
||||
|
||||
|
Reference in New Issue
Block a user