1
0
Fork 0
mirror of https://github.com/dorny/test-reporter.git synced 2026-03-22 07:52:14 +01:00

Merge pull request #725 from dorny/feature/603-migration-to-esm-modules

This commit is contained in:
Jozef Izso 2026-03-02 14:36:34 +01:00 committed by GitHub
commit 0a09b8be91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 2997 additions and 3695 deletions

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {DartJsonParser} from '../src/parsers/dart-json/dart-json-parser' import {DartJsonParser} from '../src/parsers/dart-json/dart-json-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('dart-json tests', () => { describe('dart-json tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {DotnetNunitParser} from '../src/parsers/dotnet-nunit/dotnet-nunit-parser' import {DotnetNunitParser} from '../src/parsers/dotnet-nunit/dotnet-nunit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('dotnet-nunit tests', () => { describe('dotnet-nunit tests', () => {
it('report from ./reports/dotnet test results matches snapshot', async () => { it('report from ./reports/dotnet test results matches snapshot', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {DotnetTrxParser} from '../src/parsers/dotnet-trx/dotnet-trx-parser' import {DotnetTrxParser} from '../src/parsers/dotnet-trx/dotnet-trx-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport, ReportOptions} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport, ReportOptions} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('dotnet-trx tests', () => { describe('dotnet-trx tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {GolangJsonParser} from '../src/parsers/golang-json/golang-json-parser' import {GolangJsonParser} from '../src/parsers/golang-json/golang-json-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {getReport} from '../src/report/get-report' import {getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('golang-json tests', () => { describe('golang-json tests', () => {
it('report from ./reports/dotnet test results matches snapshot', async () => { it('report from ./reports/dotnet test results matches snapshot', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {JavaJunitParser} from '../src/parsers/java-junit/java-junit-parser' import {JavaJunitParser} from '../src/parsers/java-junit/java-junit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('java-junit tests', () => { describe('java-junit tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,4 +1,4 @@
import {parseStackTraceElement} from '../src/parsers/java-junit/java-stack-trace-element-parser' import {parseStackTraceElement} from '../src/parsers/java-junit/java-stack-trace-element-parser.js'
describe('parseStackTraceLine tests', () => { describe('parseStackTraceLine tests', () => {
it('empty line is not parsed', async () => { it('empty line is not parsed', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {JestJunitParser} from '../src/parsers/jest-junit/jest-junit-parser' import {JestJunitParser} from '../src/parsers/jest-junit/jest-junit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('jest-junit tests', () => { describe('jest-junit tests', () => {
it('produces empty test run result when there are no test cases in the testsuites element', async () => { it('produces empty test run result when there are no test cases in the testsuites element', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {MochaJsonParser} from '../src/parsers/mocha-json/mocha-json-parser' import {MochaJsonParser} from '../src/parsers/mocha-json/mocha-json-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('mocha-json tests', () => { describe('mocha-json tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {PhpunitJunitParser} from '../src/parsers/phpunit-junit/phpunit-junit-parser' import {PhpunitJunitParser} from '../src/parsers/phpunit-junit/phpunit-junit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {getReport} from '../src/report/get-report' import {getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('phpunit-junit tests', () => { describe('phpunit-junit tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {PythonXunitParser} from '../src/parsers/python-xunit/python-xunit-parser' import {PythonXunitParser} from '../src/parsers/python-xunit/python-xunit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const defaultOpts: ParseOptions = { const defaultOpts: ParseOptions = {
parseErrors: true, parseErrors: true,

View file

@ -1,4 +1,4 @@
import {getBadge, DEFAULT_OPTIONS, ReportOptions} from '../../src/report/get-report' import {getBadge, DEFAULT_OPTIONS, ReportOptions} from '../../src/report/get-report.js'
describe('getBadge', () => { describe('getBadge', () => {
describe('URI encoding with special characters', () => { describe('URI encoding with special characters', () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {RspecJsonParser} from '../src/parsers/rspec-json/rspec-json-parser' import {RspecJsonParser} from '../src/parsers/rspec-json/rspec-json-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('rspec-json tests', () => { describe('rspec-json tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {SwiftXunitParser} from '../src/parsers/swift-xunit/swift-xunit-parser' import {SwiftXunitParser} from '../src/parsers/swift-xunit/swift-xunit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report' import {DEFAULT_OPTIONS, getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('swift-xunit tests', () => { describe('swift-xunit tests', () => {
it('report from swift test results matches snapshot', async () => { it('report from swift test results matches snapshot', async () => {

View file

@ -1,10 +1,15 @@
import * as fs from 'fs' import * as fs from 'fs'
import * as path from 'path' import * as path from 'path'
import {NetteTesterJunitParser} from '../src/parsers/tester-junit/tester-junit-parser' import {NetteTesterJunitParser} from '../src/parsers/tester-junit/tester-junit-parser.js'
import {ParseOptions} from '../src/test-parser' import {ParseOptions} from '../src/test-parser.js'
import {getReport} from '../src/report/get-report' import {getReport} from '../src/report/get-report.js'
import {normalizeFilePath} from '../src/utils/path-utils' import {normalizeFilePath} from '../src/utils/path-utils.js'
import {fileURLToPath} from 'url'
import {dirname} from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
describe('tester-junit tests', () => { describe('tester-junit tests', () => {
it('produces empty test run result when there are no test cases', async () => { it('produces empty test run result when there are no test cases', async () => {

View file

@ -1,4 +1,4 @@
import {parseNetDuration} from '../../src/utils/parse-utils' import {parseNetDuration} from '../../src/utils/parse-utils.js'
describe('parseNetDuration', () => { describe('parseNetDuration', () => {
it('returns 0 for 00:00:00', () => { it('returns 0 for 00:00:00', () => {

6333
dist/index.js generated vendored

File diff suppressed because it is too large Load diff

3
dist/package.json generated vendored Normal file
View file

@ -0,0 +1,3 @@
{
"type": "module"
}

View file

@ -3,9 +3,12 @@ module.exports = {
moduleFileExtensions: ['js', 'ts'], moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node', testEnvironment: 'node',
testMatch: ['**/*.test.ts'], testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: { transform: {
'^.+\\.ts$': 'ts-jest' '^.+\\.ts$': ['ts-jest', {useESM: true}]
}, },
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
},
extensionsToTreatAsEsm: ['.ts'],
verbose: true verbose: true
} }

View file

@ -3,6 +3,7 @@
"version": "2.5.0", "version": "2.5.0",
"private": true, "private": true,
"description": "Presents test results from popular testing frameworks as Github check run", "description": "Presents test results from popular testing frameworks as Github check run",
"type": "module",
"main": "lib/main.js", "main": "lib/main.js",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
@ -11,7 +12,7 @@
"lint": "eslint src/**/*.ts", "lint": "eslint src/**/*.ts",
"package": "ncc build --license licenses.txt && eolConverter lf 'dist/*'", "package": "ncc build --license licenses.txt && eolConverter lf 'dist/*'",
"version": "npm run build && npm run package && git add dist/*", "version": "npm run build && npm run package && git add dist/*",
"test": "jest --ci --reporters=default --reporters=jest-junit", "test": "NODE_OPTIONS='--experimental-vm-modules' jest --ci --reporters=default --reporters=jest-junit",
"jest:updatesnapshot": "jest --updateSnapshot", "jest:updatesnapshot": "jest --updateSnapshot",
"all": "npm run build && npm run format && npm run lint && npm run package && npm test", "all": "npm run build && npm run format && npm run lint && npm run package && npm test",
"dart-fixture": "cd \"reports/dart\" && dart test --file-reporter=\"json:../../__tests__/fixtures/dart-json.json\"", "dart-fixture": "cd \"reports/dart\" && dart test --file-reporter=\"json:../../__tests__/fixtures/dart-json.json\"",

View file

@ -1,12 +1,12 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import * as github from '@actions/github' import * as github from '@actions/github'
import {GitHub} from '@actions/github/lib/utils' import {GitHub} from '@actions/github/lib/utils.js'
import Zip from 'adm-zip' import Zip from 'adm-zip'
import picomatch from 'picomatch' import picomatch from 'picomatch'
import {FileContent, InputProvider, ReportInput} from './input-provider' import {FileContent, InputProvider, ReportInput} from './input-provider.js'
import {downloadArtifact, listFiles} from '../utils/github-utils' import {downloadArtifact, listFiles} from '../utils/github-utils.js'
export class ArtifactProvider implements InputProvider { export class ArtifactProvider implements InputProvider {
private readonly artifactNameMatch: (name: string) => boolean private readonly artifactNameMatch: (name: string) => boolean

View file

@ -1,7 +1,7 @@
import * as fs from 'fs' import * as fs from 'fs'
import glob from 'fast-glob' import glob from 'fast-glob'
import {FileContent, InputProvider, ReportInput} from './input-provider' import {FileContent, InputProvider, ReportInput} from './input-provider.js'
import {listFiles} from '../utils/git' import {listFiles} from '../utils/git.js'
export class LocalFileProvider implements InputProvider { export class LocalFileProvider implements InputProvider {
constructor( constructor(

View file

@ -1,29 +1,29 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import * as github from '@actions/github' import * as github from '@actions/github'
import {GitHub} from '@actions/github/lib/utils' import {GitHub} from '@actions/github/lib/utils.js'
import {ArtifactProvider} from './input-providers/artifact-provider' import {ArtifactProvider} from './input-providers/artifact-provider.js'
import {LocalFileProvider} from './input-providers/local-file-provider' import {LocalFileProvider} from './input-providers/local-file-provider.js'
import {FileContent} from './input-providers/input-provider' import {FileContent} from './input-providers/input-provider.js'
import {ParseOptions, TestParser} from './test-parser' import {ParseOptions, TestParser} from './test-parser.js'
import {TestRunResult} from './test-results' import {TestRunResult} from './test-results.js'
import {getAnnotations} from './report/get-annotations' import {getAnnotations} from './report/get-annotations.js'
import {getReport} from './report/get-report' import {getReport} from './report/get-report.js'
import {DartJsonParser} from './parsers/dart-json/dart-json-parser' import {DartJsonParser} from './parsers/dart-json/dart-json-parser.js'
import {DotnetNunitParser} from './parsers/dotnet-nunit/dotnet-nunit-parser' import {DotnetNunitParser} from './parsers/dotnet-nunit/dotnet-nunit-parser.js'
import {DotnetTrxParser} from './parsers/dotnet-trx/dotnet-trx-parser' import {DotnetTrxParser} from './parsers/dotnet-trx/dotnet-trx-parser.js'
import {GolangJsonParser} from './parsers/golang-json/golang-json-parser' import {GolangJsonParser} from './parsers/golang-json/golang-json-parser.js'
import {JavaJunitParser} from './parsers/java-junit/java-junit-parser' import {JavaJunitParser} from './parsers/java-junit/java-junit-parser.js'
import {JestJunitParser} from './parsers/jest-junit/jest-junit-parser' import {JestJunitParser} from './parsers/jest-junit/jest-junit-parser.js'
import {MochaJsonParser} from './parsers/mocha-json/mocha-json-parser' import {MochaJsonParser} from './parsers/mocha-json/mocha-json-parser.js'
import {PhpunitJunitParser} from './parsers/phpunit-junit/phpunit-junit-parser' import {PhpunitJunitParser} from './parsers/phpunit-junit/phpunit-junit-parser.js'
import {PythonXunitParser} from './parsers/python-xunit/python-xunit-parser' import {PythonXunitParser} from './parsers/python-xunit/python-xunit-parser.js'
import {RspecJsonParser} from './parsers/rspec-json/rspec-json-parser' import {RspecJsonParser} from './parsers/rspec-json/rspec-json-parser.js'
import {SwiftXunitParser} from './parsers/swift-xunit/swift-xunit-parser' import {SwiftXunitParser} from './parsers/swift-xunit/swift-xunit-parser.js'
import {NetteTesterJunitParser} from './parsers/tester-junit/tester-junit-parser' import {NetteTesterJunitParser} from './parsers/tester-junit/tester-junit-parser.js'
import {normalizeDirPath, normalizeFilePath} from './utils/path-utils' import {normalizeDirPath, normalizeFilePath} from './utils/path-utils.js'
import {getCheckRunContext} from './utils/github-utils' import {getCheckRunContext} from './utils/github-utils.js'
async function main(): Promise<void> { async function main(): Promise<void> {
try { try {

View file

@ -1,6 +1,6 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import { import {
ReportEvent, ReportEvent,
@ -17,7 +17,7 @@ import {
isDoneEvent, isDoneEvent,
isMessageEvent, isMessageEvent,
MessageEvent MessageEvent
} from './dart-json-types' } from './dart-json-types.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -26,7 +26,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
class TestRun { class TestRun {
constructor( constructor(

View file

@ -1,9 +1,9 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {NunitReport, TestCase, TestSuite} from './dotnet-nunit-types' import {NunitReport, TestCase, TestSuite} from './dotnet-nunit-types.js'
import {getExceptionSource} from '../../utils/node-utils' import {getExceptionSource} from '../../utils/node-utils.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -12,7 +12,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
export class DotnetNunitParser implements TestParser { export class DotnetNunitParser implements TestParser {
assumedWorkDir: string | undefined assumedWorkDir: string | undefined

View file

@ -1,10 +1,10 @@
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {ErrorInfo, Outcome, TrxReport, UnitTest, UnitTestResult} from './dotnet-trx-types' import {ErrorInfo, Outcome, TrxReport, UnitTest, UnitTestResult} from './dotnet-trx-types.js'
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import {parseIsoDate, parseNetDuration} from '../../utils/parse-utils' import {parseIsoDate, parseNetDuration} from '../../utils/parse-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -13,7 +13,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
class TestClass { class TestClass {
constructor(readonly name: string) {} constructor(readonly name: string) {}

View file

@ -1,8 +1,8 @@
import { ParseOptions, TestParser } from '../../test-parser' import { ParseOptions, TestParser } from '../../test-parser.js'
import { GoTestEvent } from './golang-json-types' import { GoTestEvent } from './golang-json-types.js'
import { getExceptionSource } from '../../utils/node-utils' import { getExceptionSource } from '../../utils/node-utils.js'
import { getBasePath, normalizeFilePath } from '../../utils/path-utils' import { getBasePath, normalizeFilePath } from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -11,7 +11,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
export class GolangJsonParser implements TestParser { export class GolangJsonParser implements TestParser {
assumedWorkDir: string | undefined assumedWorkDir: string | undefined

View file

@ -1,10 +1,10 @@
import * as path from 'path' import * as path from 'path'
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {JunitReport, SingleSuiteReport, TestCase, TestSuite} from './java-junit-types' import {JunitReport, SingleSuiteReport, TestCase, TestSuite} from './java-junit-types.js'
import {parseStackTraceElement} from './java-stack-trace-element-parser' import {parseStackTraceElement} from './java-stack-trace-element-parser.js'
import {normalizeFilePath} from '../../utils/path-utils' import {normalizeFilePath} from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -13,7 +13,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
export class JavaJunitParser implements TestParser { export class JavaJunitParser implements TestParser {
readonly trackedFiles: {[fileName: string]: string[]} readonly trackedFiles: {[fileName: string]: string[]}

View file

@ -1,9 +1,9 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {JunitReport, TestCase, TestSuite} from './jest-junit-types' import {JunitReport, TestCase, TestSuite} from './jest-junit-types.js'
import {getExceptionSource} from '../../utils/node-utils' import {getExceptionSource} from '../../utils/node-utils.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -12,7 +12,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
export class JestJunitParser implements TestParser { export class JestJunitParser implements TestParser {
assumedWorkDir: string | undefined assumedWorkDir: string | undefined

View file

@ -1,4 +1,4 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import { import {
TestCaseError, TestCaseError,
TestCaseResult, TestCaseResult,
@ -6,10 +6,10 @@ import {
TestGroupResult, TestGroupResult,
TestRunResult, TestRunResult,
TestSuiteResult TestSuiteResult
} from '../../test-results' } from '../../test-results.js'
import {getExceptionSource} from '../../utils/node-utils' import {getExceptionSource} from '../../utils/node-utils.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import {MochaJson, MochaJsonTest} from './mocha-json-types' import {MochaJson, MochaJsonTest} from './mocha-json-types.js'
export class MochaJsonParser implements TestParser { export class MochaJsonParser implements TestParser {
assumedWorkDir: string | undefined assumedWorkDir: string | undefined

View file

@ -1,8 +1,8 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {PhpunitReport, SingleSuiteReport, TestCase, TestSuite} from './phpunit-junit-types' import {PhpunitReport, SingleSuiteReport, TestCase, TestSuite} from './phpunit-junit-types.js'
import {getBasePath, normalizeFilePath} from '../../utils/path-utils' import {getBasePath, normalizeFilePath} from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -11,7 +11,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
export class PhpunitJunitParser implements TestParser { export class PhpunitJunitParser implements TestParser {
readonly trackedFiles: Set<string> readonly trackedFiles: Set<string>

View file

@ -1,5 +1,5 @@
import {ParseOptions} from '../../test-parser' import {ParseOptions} from '../../test-parser.js'
import {JavaJunitParser} from '../java-junit/java-junit-parser' import {JavaJunitParser} from '../java-junit/java-junit-parser.js'
export class PythonXunitParser extends JavaJunitParser { export class PythonXunitParser extends JavaJunitParser {
constructor(readonly options: ParseOptions) { constructor(readonly options: ParseOptions) {

View file

@ -1,4 +1,4 @@
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import { import {
TestCaseError, TestCaseError,
TestCaseResult, TestCaseResult,
@ -6,8 +6,8 @@ import {
TestGroupResult, TestGroupResult,
TestRunResult, TestRunResult,
TestSuiteResult TestSuiteResult
} from '../../test-results' } from '../../test-results.js'
import {RspecJson, RspecExample} from './rspec-json-types' import {RspecJson, RspecExample} from './rspec-json-types.js'
export class RspecJsonParser implements TestParser { export class RspecJsonParser implements TestParser {
assumedWorkDir: string | undefined assumedWorkDir: string | undefined

View file

@ -1,5 +1,5 @@
import {ParseOptions} from '../../test-parser' import {ParseOptions} from '../../test-parser.js'
import {JavaJunitParser} from '../java-junit/java-junit-parser' import {JavaJunitParser} from '../java-junit/java-junit-parser.js'
export class SwiftXunitParser extends JavaJunitParser { export class SwiftXunitParser extends JavaJunitParser {
constructor(readonly options: ParseOptions) { constructor(readonly options: ParseOptions) {

View file

@ -1,9 +1,9 @@
import * as path from 'path' import * as path from 'path'
import {ParseOptions, TestParser} from '../../test-parser' import {ParseOptions, TestParser} from '../../test-parser.js'
import {parseStringPromise} from 'xml2js' import {parseStringPromise} from 'xml2js'
import {NetteTesterReport, SingleSuiteReport, TestCase, TestSuite} from './tester-junit-types' import {NetteTesterReport, SingleSuiteReport, TestCase, TestSuite} from './tester-junit-types.js'
import {normalizeFilePath} from '../../utils/path-utils' import {normalizeFilePath} from '../../utils/path-utils.js'
import { import {
TestExecutionResult, TestExecutionResult,
@ -12,7 +12,7 @@ import {
TestGroupResult, TestGroupResult,
TestCaseResult, TestCaseResult,
TestCaseError TestCaseError
} from '../../test-results' } from '../../test-results.js'
interface ParsedTestName { interface ParsedTestName {
filePath: string filePath: string

View file

@ -1,6 +1,6 @@
import {ellipsis, fixEol} from '../utils/markdown-utils' import {ellipsis, fixEol} from '../utils/markdown-utils.js'
import {TestRunResult} from '../test-results' import {TestRunResult} from '../test-results.js'
import {getFirstNonEmptyLine} from '../utils/parse-utils' import {getFirstNonEmptyLine} from '../utils/parse-utils.js'
type Annotation = { type Annotation = {
path: string path: string

View file

@ -1,9 +1,9 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import {TestExecutionResult, TestRunResult, TestSuiteResult} from '../test-results' import {TestExecutionResult, TestRunResult, TestSuiteResult} from '../test-results.js'
import {Align, formatTime, Icon, link, table} from '../utils/markdown-utils' import {Align, formatTime, Icon, link, table} from '../utils/markdown-utils.js'
import {DEFAULT_LOCALE} from '../utils/node-utils' import {DEFAULT_LOCALE} from '../utils/node-utils.js'
import {getFirstNonEmptyLine} from '../utils/parse-utils' import {getFirstNonEmptyLine} from '../utils/parse-utils.js'
import {slug} from '../utils/slugger' import {slug} from '../utils/slugger.js'
const MAX_REPORT_LENGTH = 65535 const MAX_REPORT_LENGTH = 65535
const MAX_ACTIONS_SUMMARY_LENGTH = 1048576 const MAX_ACTIONS_SUMMARY_LENGTH = 1048576

View file

@ -1,4 +1,4 @@
import {TestRunResult} from './test-results' import {TestRunResult} from './test-results.js'
export interface ParseOptions { export interface ParseOptions {
parseErrors: boolean parseErrors: boolean

View file

@ -1,4 +1,4 @@
import {DEFAULT_LOCALE} from './utils/node-utils' import {DEFAULT_LOCALE} from './utils/node-utils.js'
export class TestRunResult { export class TestRunResult {
constructor( constructor(

View file

@ -3,7 +3,7 @@ import {pipeline} from 'stream/promises'
import {Readable, Transform} from 'stream' import {Readable, Transform} from 'stream'
import * as core from '@actions/core' import * as core from '@actions/core'
import * as github from '@actions/github' import * as github from '@actions/github'
import {GitHub} from '@actions/github/lib/utils' import {GitHub} from '@actions/github/lib/utils.js'
import type {PullRequest, WorkflowRunEvent} from '@octokit/webhooks-types' import type {PullRequest, WorkflowRunEvent} from '@octokit/webhooks-types'
export function getCheckRunContext(): {sha: string; runId: number} { export function getCheckRunContext(): {sha: string; runId: number} {

View file

@ -1,4 +1,4 @@
import {normalizeFilePath} from './path-utils' import {normalizeFilePath} from './path-utils.js'
export const DEFAULT_LOCALE = 'en-US' export const DEFAULT_LOCALE = 'en-US'

View file

@ -1,7 +1,7 @@
// Returns HTML element id and href link usable as manual anchor links // Returns HTML element id and href link usable as manual anchor links
// This is needed because Github in check run summary doesn't automatically // This is needed because Github in check run summary doesn't automatically
// create links out of headings as it normally does for other markdown content // create links out of headings as it normally does for other markdown content
import {ReportOptions} from '../report/get-report' import {ReportOptions} from '../report/get-report.js'
export function slug(name: string, options: ReportOptions): {id: string; link: string} { export function slug(name: string, options: ReportOptions): {id: string; link: string} {
const slugId = name const slugId = name

View file

@ -1,13 +1,13 @@
{ {
"compilerOptions": { "compilerOptions": {
"lib": ["es2023"], "lib": ["es2023"],
"module": "node16", "module": "nodenext",
"target": "es2022", "target": "es2022",
"strict": true, "strict": true,
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true, "skipLibCheck": true,
"moduleResolution": "node16", "moduleResolution": "nodenext",
"isolatedModules": true, "isolatedModules": true,
"outDir": "./lib", "outDir": "./lib",