1
0

Migrate to ESM and upgrade dependencies (#752)

* Migrate to ESM and upgrade dependencies

* Address review: use type-only import for QualityOptions

* update version to 6.0.0 in package.json and package-lock.json

* Add ESM migration note to README for V6

* Update test imports for ESM and clean up devDependencies (ts-node, @types/jest)

* Pin @types/node to 24.x and refine tsconfig/README wording
This commit is contained in:
Priya Gupta
2026-07-16 02:11:57 +05:30
committed by GitHub
parent 26b0ec14cb
commit 6df8cefd14
78 changed files with 117103 additions and 102620 deletions
+19 -10
View File
@@ -1,22 +1,31 @@
import {DotnetVersionResolver} from '../src/installer';
import * as hc from '@actions/http-client';
import * as core from '@actions/core';
import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
// Mock http-client
jest.mock('@actions/http-client');
jest.unstable_mockModule('@actions/http-client', () => ({
HttpClient: jest.fn()
}));
jest.unstable_mockModule('@actions/core', () => ({
warning: jest.fn(),
info: jest.fn(),
debug: jest.fn()
}));
const hc = await import('@actions/http-client');
const core = await import('@actions/core');
const {DotnetVersionResolver} = await import('../src/installer.js');
describe('DotnetVersionResolver with latest', () => {
let getJsonMock: jest.Mock;
let warningSpy: jest.SpyInstance;
let getJsonMock: jest.Mock<(...args: any[]) => Promise<any>>;
let warningSpy: jest.Mock;
beforeEach(() => {
getJsonMock = jest.fn();
(hc.HttpClient as any).mockImplementation(() => {
getJsonMock = jest.fn<(...args: any[]) => Promise<any>>();
(hc.HttpClient as jest.Mock).mockImplementation(() => {
return {
getJson: getJsonMock
};
});
warningSpy = jest.spyOn(core, 'warning').mockImplementation(() => {});
warningSpy = core.warning as jest.Mock;
warningSpy.mockImplementation(() => {});
});
afterEach(() => {