Skip to content

Commit e23bf58

Browse files
committed
Add path aliasing and more tests
1 parent f466f32 commit e23bf58

4 files changed

Lines changed: 937 additions & 16 deletions

File tree

jest.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export default {
1717
],
1818
coverageReporters: ["text", "lcov", "cobertura"],
1919
transformIgnorePatterns: ["/node_modules/", "\\.pnp\\.[^\\/]+$"],
20+
moduleNameMapper: {
21+
"^@/(.*)$": "<rootDir>/src/$1",
22+
"^@open-api/(.*)$": "<rootDir>/src/open-api/$1",
23+
"^@test-utils/(.*)$": "<rootDir>/src/integration-tests/utils/$1",
24+
},
2025
transform: {
2126
"^.+\\.tsx?$": [
2227
"ts-jest",

src/sdk/clients/worker/TaskRunner.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,15 @@ export class TaskRunner {
310310
handleUnknownError = (unknownError: unknown) => {
311311
let message = "";
312312
let stack: string | undefined = "";
313-
if ((unknownError as Error).stack) {
314-
stack = (unknownError as Error).stack;
315-
}
316-
if ((unknownError as Error).message) {
317-
message = (unknownError as Error).message;
313+
if (unknownError && typeof unknownError === "object") {
314+
if ("stack" in unknownError) {
315+
stack = (unknownError as Error).stack;
316+
}
317+
if ("message" in unknownError) {
318+
message = (unknownError as Error).message;
319+
}
320+
} else if (typeof unknownError === "string") {
321+
message = unknownError;
318322
}
319323
this.logger.error(
320324
`Error for ${this.worker.taskDefName}: error: ${message}, stack: ${stack}`

0 commit comments

Comments
 (0)