Skip to content

Commit 7fbb759

Browse files
author
David Buzinski
committed
update module definition to allow us to use newest versions from actions toolkit
1 parent aebe6ad commit 7fbb759

11 files changed

Lines changed: 251 additions & 78 deletions

jest.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

jest.config.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default {
2+
testEnvironment: "node",
3+
collectCoverage: true,
4+
testMatch: ["**/*.test.ts"],
5+
transform: {
6+
"^.+\\.[jt]s$": [
7+
"ts-jest",
8+
{
9+
diagnostics: {
10+
ignoreCodes: [151002],
11+
},
12+
},
13+
],
14+
},
15+
transformIgnorePatterns: ["node_modules/(?!(@actions)/)"],
16+
moduleNameMapper: {
17+
"^(\\.{1,2}/.*)\\.js$": "$1",
18+
"^@actions/core$": "<rootDir>/node_modules/@actions/core/lib/core.js",
19+
"^@actions/exec$": "<rootDir>/node_modules/@actions/exec/lib/exec.js",
20+
},
21+
};

package-lock.json

Lines changed: 211 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"author": "The MathWorks, Inc.",
44
"version": "1.0.1",
55
"description": "",
6+
"type": "module",
67
"main": "lib/index.js",
78
"scripts": {
89
"clean": "rm -rf dist lib",
@@ -21,8 +22,8 @@
2122
"plugins/"
2223
],
2324
"dependencies": {
24-
"@actions/core": "^1.11.1",
25-
"@actions/exec": "^1.1.1",
25+
"@actions/core": "^3.0.0",
26+
"@actions/exec": "^3.0.0",
2627
"uuid": "^11.1.0"
2728
},
2829
"devDependencies": {
@@ -35,8 +36,12 @@
3536
"jsdom": "^26.1.0",
3637
"prettier": "3.6.2",
3738
"ts-jest": "^29.4.1",
39+
"ts-node": "^10.9.2",
3840
"typescript": "^5.9.2"
3941
},
42+
"overrides": {
43+
"undici": "^7.22.0"
44+
},
4045
"repository": {
4146
"type": "git",
4247
"url": "git+https://github.com/matlab-actions/common-utils.git"

src/buildSummary.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2024-25 The MathWorks, Inc.
22

3-
import * as buildSummary from './buildSummary';
3+
import * as buildSummary from './buildSummary.js';
44
import * as core from '@actions/core';
55

66
jest.mock('@actions/core', () => ({

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2025 The MathWorks, Inc.
22

3-
import * as testResultsSummary from "./testResultsSummary";
4-
import * as buildSummary from "./buildSummary";
5-
import * as matlab from "./matlab";
3+
import * as testResultsSummary from "./testResultsSummary.js";
4+
import * as buildSummary from "./buildSummary.js";
5+
import * as matlab from "./matlab.js";
66

77
export { testResultsSummary, buildSummary, matlab };

src/matlab.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { promises as fs } from "fs";
44
import * as os from "os";
55
import * as path from "path";
66
import { v4 as uuid } from "uuid";
7-
import * as script from "./script";
7+
import * as script from "./script.js";
88

99
/**
1010
* Helper interface to represent a MATLAB script.

src/matlab.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { promises as fs } from "fs";
44
import * as path from "path";
5-
import * as matlab from "./matlab";
5+
import * as matlab from "./matlab.js";
66

77
afterEach(() => {
88
jest.resetAllMocks();

src/script.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2020-2025 The MathWorks, Inc.
22

3-
import * as script from "./script";
3+
import * as script from "./script.js";
44
import * as path from "path";
55

66
describe("call generation", () => {

src/testResultsSummary.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2025 The MathWorks, Inc.
22

3-
import * as testResultsSummary from "./testResultsSummary";
3+
import * as testResultsSummary from "./testResultsSummary.js";
44
import * as path from "path";
55
import * as fs from "fs";
66
import * as core from "@actions/core";
@@ -41,7 +41,7 @@ describe("Artifact Processing Tests", () => {
4141
});
4242

4343
function getOSInfo() {
44-
const os = require("os").platform().toLowerCase();
44+
const os = process.platform.toLowerCase();
4545
if (os.includes("win") && !os.includes("darwin"))
4646
return { osName: "windows", workspaceParent: "C:\\" };
4747
if (os.includes("linux") || os.includes("unix") || os.includes("aix"))

0 commit comments

Comments
 (0)