Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .licenses/npm/data-uri-to-buffer.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .licenses/npm/node-domexception.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 9 additions & 20 deletions .licenses/npm/node-fetch.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions .licenses/npm/web-streams-polyfill.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 0 additions & 23 deletions .licenses/npm/webidl-conversions.dep.yml

This file was deleted.

15 changes: 10 additions & 5 deletions __tests__/authutil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@ import fs from 'fs';
import * as path from 'path';
import * as core from '@actions/core';
import * as io from '@actions/io';
import * as auth from '../src/authutil';
import * as cacheUtils from '../src/cache-utils';
import * as auth from '../src/authutil.js';
import * as cacheUtils from '../src/cache-utils.js';
import {fileURLToPath} from 'url';
import {jest, describe, beforeEach, afterEach, it, expect} from '@jest/globals';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

let rcFile: string;

describe('authutil tests', () => {
const _runnerDir = path.join(__dirname, 'runner');

let cnSpy: jest.SpyInstance;
let logSpy: jest.SpyInstance;
let dbgSpy: jest.SpyInstance;
let cnSpy: any;
let logSpy: any;
let dbgSpy: any;
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'any' type defeats TypeScript's type safety. Consider using proper Jest spy types like 'jest.SpyInstance' or importing the specific types from '@jest/globals'.

Suggested change
let cnSpy: any;
let logSpy: any;
let dbgSpy: any;
let cnSpy: jest.SpyInstance;
let logSpy: jest.SpyInstance;
let dbgSpy: jest.SpyInstance;

Copilot uses AI. Check for mistakes.

beforeAll(async () => {
const randPath = path.join(Math.random().toString(36).substring(7));
Expand Down
8 changes: 6 additions & 2 deletions __tests__/cache-restore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ import * as cache from '@actions/cache';
import * as path from 'path';
import * as glob from '@actions/glob';
import osm from 'os';
import {fileURLToPath} from 'url';

import * as utils from '../src/cache-utils';
import {restoreCache} from '../src/cache-restore';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

import * as utils from '../src/cache-utils.js';
import {restoreCache} from '../src/cache-restore.js';

describe('cache-restore', () => {
process.env['GITHUB_WORKSPACE'] = path.join(__dirname, 'data');
Expand Down
10 changes: 7 additions & 3 deletions __tests__/cache-save.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import * as cache from '@actions/cache';
import * as glob from '@actions/glob';
import fs from 'fs';
import path from 'path';
import {fileURLToPath} from 'url';

import * as utils from '../src/cache-utils';
import {run} from '../src/cache-save';
import {State} from '../src/constants';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

import * as utils from '../src/cache-utils.js';
import {run} from '../src/cache-save.js';
import {State} from '../src/constants.js';

describe('run', () => {
const yarnFileHash =
Expand Down
12 changes: 8 additions & 4 deletions __tests__/cache-utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import * as core from '@actions/core';
import * as cache from '@actions/cache';
import path from 'path';
import * as utils from '../src/cache-utils';
import * as utils from '../src/cache-utils.js';
import {
PackageManagerInfo,
isCacheFeatureAvailable,
supportedPackageManagers,
isGhes,
resetProjectDirectoriesMemoized
} from '../src/cache-utils';
} from '../src/cache-utils.js';
import fs from 'fs';
import * as cacheUtils from '../src/cache-utils';
import * as cacheUtils from '../src/cache-utils.js';
import * as glob from '@actions/glob';
import {Globber} from '@actions/glob';
import {MockGlobber} from './mock/glob-mock';
import {MockGlobber} from './mock/glob-mock.js';
import {fileURLToPath} from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

describe('cache-utils', () => {
const versionYarn1 = '1.2.3';
Expand Down
6 changes: 3 additions & 3 deletions __tests__/canary-installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import fs from 'fs';
import cp from 'child_process';
import osm from 'os';
import path from 'path';
import * as main from '../src/main';
import * as auth from '../src/authutil';
import {INodeVersion} from '../src/distributions/base-models';
import * as main from '../src/main.js';
import * as auth from '../src/authutil.js';
import {INodeVersion} from '../src/distributions/base-models.js';

import nodeTestManifest from './data/versions-manifest.json';
import nodeTestDist from './data/node-dist-index.json';
Expand Down
10 changes: 7 additions & 3 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ import * as io from '@actions/io';
import fs from 'fs';
import path from 'path';
import osm from 'os';
import {fileURLToPath} from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

import each from 'jest-each';

import * as main from '../src/main';
import * as util from '../src/util';
import OfficialBuilds from '../src/distributions/official_builds/official_builds';
import * as main from '../src/main.js';
import * as util from '../src/util.js';
import OfficialBuilds from '../src/distributions/official_builds/official_builds.js';

describe('main tests', () => {
let inputs = {} as any;
Expand Down
2 changes: 1 addition & 1 deletion __tests__/mock/glob-mock.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {MockGlobber} from './glob-mock';
import {MockGlobber} from './glob-mock.js';

describe('mocked globber tests', () => {
it('globber should return generator', async () => {
Expand Down
6 changes: 3 additions & 3 deletions __tests__/nightly-installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import fs from 'fs';
import cp from 'child_process';
import osm from 'os';
import path from 'path';
import * as main from '../src/main';
import * as auth from '../src/authutil';
import {INodeVersion} from '../src/distributions/base-models';
import * as main from '../src/main.js';
import * as auth from '../src/authutil.js';
import {INodeVersion} from '../src/distributions/base-models.js';

import nodeTestManifest from './data/versions-manifest.json';
import nodeTestDist from './data/node-dist-index.json';
Expand Down
6 changes: 3 additions & 3 deletions __tests__/rc-installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import fs from 'fs';
import cp from 'child_process';
import osm from 'os';
import path from 'path';
import * as main from '../src/main';
import * as auth from '../src/authutil';
import {INodeVersion} from '../src/distributions/base-models';
import * as main from '../src/main.js';
import * as auth from '../src/authutil.js';
import {INodeVersion} from '../src/distributions/base-models.js';

import nodeTestDist from './data/node-dist-index.json';
import nodeTestDistNightly from './data/node-nightly-index.json';
Expand Down
Loading
Loading