mirror of
https://github.com/actions/stale.git
synced 2026-12-01 00:43:04 +00:00
refactor: update imports to use ES module syntax and improve test structure (#1350)
- Changed import statements across multiple files to use the .js extension for ES module compatibility. - Refactored test files to utilize jest's unstable_mockModule for mocking core actions. - Removed unnecessary spy instances in tests, replacing them with direct mocked function calls. - Updated TypeScript configuration to target ES2022 and use NodeNext module resolution. - Removed the tsconfig.spec.json file and adjusted the main tsconfig.json to exclude test files.
This commit is contained in:
14
src/main.ts
14
src/main.ts
@@ -1,9 +1,9 @@
|
||||
import * as core from '@actions/core';
|
||||
import {IssuesProcessor} from './classes/issues-processor';
|
||||
import {isValidDate} from './functions/dates/is-valid-date';
|
||||
import {IIssuesProcessorOptions} from './interfaces/issues-processor-options';
|
||||
import {Issue} from './classes/issue';
|
||||
import {getStateInstance} from './services/state.service';
|
||||
import {IssuesProcessor} from './classes/issues-processor.js';
|
||||
import {isValidDate} from './functions/dates/is-valid-date.js';
|
||||
import {IIssuesProcessorOptions} from './interfaces/issues-processor-options.js';
|
||||
import {Issue} from './classes/issue.js';
|
||||
import {getStateInstance} from './services/state.service.js';
|
||||
|
||||
async function _run(): Promise<void> {
|
||||
try {
|
||||
@@ -206,8 +206,8 @@ function _processParamtoString(
|
||||
return sortByValueInput === 'updated'
|
||||
? 'updated'
|
||||
: sortByValueInput === 'comments'
|
||||
? 'comments'
|
||||
: 'created';
|
||||
? 'comments'
|
||||
: 'created';
|
||||
}
|
||||
|
||||
void _run();
|
||||
|
||||
Reference in New Issue
Block a user