Update tests

This commit is contained in:
Uladzimir Havenchyk 2022-08-01 12:03:42 +03:00
parent 8f9fe012e3
commit 2ebb54b081
No known key found for this signature in database
GPG key ID: CAE771D3036BED13
3 changed files with 9 additions and 7 deletions

View file

@ -41,7 +41,6 @@ describe('setup-node', () => {
let parseNodeVersionSpy: jest.SpyInstance;
let isCacheActionAvailable: jest.SpyInstance;
let getExecOutputSpy: jest.SpyInstance;
let execExecSpy: jest.SpyInstance;
beforeEach(() => {
// @actions/core
@ -58,7 +57,6 @@ describe('setup-node', () => {
archSpy = jest.spyOn(osm, 'arch');
archSpy.mockImplementation(() => os['arch']);
execSpy = jest.spyOn(cp, 'execSync');
execExecSpy = jest.spyOn(exec, 'exec');
// @actions/tool-cache
findSpy = jest.spyOn(tc, 'find');
@ -251,18 +249,21 @@ describe('setup-node', () => {
let expPath = path.join(toolPath, 'bin');
expect(execExecSpy).toHaveBeenCalledWith('node', ['--version']);
expect(execExecSpy).toHaveBeenCalledWith(
expect(getExecOutputSpy).toHaveBeenCalledWith(
'node',
['--version'],
expect.anything()
);
expect(getExecOutputSpy).toHaveBeenCalledWith(
'npm',
['--version'],
expect.anything()
);
expect(execExecSpy).toHaveBeenCalledWith(
expect(getExecOutputSpy).toHaveBeenCalledWith(
'yarn',
['--version'],
expect.anything()
);
expect(dlSpy).toHaveBeenCalled();
expect(exSpy).toHaveBeenCalled();
expect(logSpy).toHaveBeenCalledWith(

1
dist/setup/index.js vendored
View file

@ -71906,6 +71906,7 @@ function printEnvDetailsAndSetOutput() {
core.endGroup();
});
}
exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput;
function getToolVersion(tool, options) {
return __awaiter(this, void 0, void 0, function* () {
try {

View file

@ -99,7 +99,7 @@ function resolveVersionInput(): string {
return version;
}
async function printEnvDetailsAndSetOutput() {
export async function printEnvDetailsAndSetOutput() {
core.startGroup('Environment details');
const promises = ['node', 'npm', 'yarn'].map(async tool => {