|
2 | 2 |
|
3 | 3 | import {jest, describe, it, expect, beforeAll} from "@jest/globals"; |
4 | 4 | import * as path from "path"; |
5 | | -import * as os from "node:os"; |
6 | | -import * as nodeFs from "node:fs"; |
| 5 | +import * as os from "os"; |
| 6 | +import * as nodeFs from "fs"; |
7 | 7 | import { JSDOM } from "jsdom"; |
8 | | -import type * as TestResultsSummaryTypes from "./testResultsSummary.js"; |
| 8 | +import type { TestResultsData, MatlabTestFile, TestStatistics } from "./testResultsSummary.js"; |
9 | 9 |
|
10 | 10 | // Mock @actions/core |
11 | 11 | jest.unstable_mockModule("@actions/core", () => ({ |
@@ -33,9 +33,9 @@ const {MatlabTestStatus} = testResultsSummary; |
33 | 33 |
|
34 | 34 | describe("Artifact Processing Tests", () => { |
35 | 35 | // Shared test data |
36 | | - let testResultsData: TestResultsSummaryTypes.TestResultsData | null; |
37 | | - let testResults: TestResultsSummaryTypes.MatlabTestFile[][]; |
38 | | - let stats: TestResultsSummaryTypes.TestStatistics; |
| 36 | + let testResultsData: TestResultsData | null; |
| 37 | + let testResults: MatlabTestFile[][]; |
| 38 | + let stats: TestStatistics; |
39 | 39 |
|
40 | 40 | beforeAll(() => { |
41 | 41 | const runnerTemp = path.join(import.meta.dirname, ".."); |
@@ -192,7 +192,7 @@ describe("HTML Structure Tests", () => { |
192 | 192 | }); |
193 | 193 |
|
194 | 194 | it("should generate valid HTML table structure for header", () => { |
195 | | - const mockStats: TestResultsSummaryTypes.TestStatistics = { |
| 195 | + const mockStats: TestStatistics = { |
196 | 196 | Total: 10, |
197 | 197 | Passed: 4, |
198 | 198 | Failed: 3, |
@@ -236,7 +236,7 @@ describe("HTML Structure Tests", () => { |
236 | 236 | }); |
237 | 237 |
|
238 | 238 | it("should generate valid HTML for detailed results with proper details tags for both passed and failed tests", () => { |
239 | | - const mockTestResults: TestResultsSummaryTypes.MatlabTestFile[][] = [ |
| 239 | + const mockTestResults: MatlabTestFile[][] = [ |
240 | 240 | [ |
241 | 241 | { |
242 | 242 | Name: "TestExamples1", |
@@ -341,16 +341,16 @@ describe("Error Handling Tests", () => { |
341 | 341 | throw new Error("Mock error in addHeading"); |
342 | 342 | }); |
343 | 343 |
|
344 | | - const mockStats: TestResultsSummaryTypes.TestStatistics = { |
| 344 | + const mockStats: TestStatistics = { |
345 | 345 | Total: 1, |
346 | 346 | Passed: 1, |
347 | 347 | Failed: 0, |
348 | 348 | Incomplete: 0, |
349 | 349 | NotRun: 0, |
350 | 350 | Duration: 0.5, |
351 | 351 | }; |
352 | | - const mockTestResults: TestResultsSummaryTypes.MatlabTestFile[][] = []; |
353 | | - const mockTestResultsData: TestResultsSummaryTypes.TestResultsData = { |
| 352 | + const mockTestResults: MatlabTestFile[][] = []; |
| 353 | + const mockTestResultsData: TestResultsData = { |
354 | 354 | TestResults: mockTestResults, |
355 | 355 | Stats: mockStats, |
356 | 356 | }; |
|
0 commit comments