Skip to content

Commit c23f23d

Browse files
authored
chore(orchestrator): migrate to Jest 30 (#3017)
Install Jest 30 peer dependencies as required by @backstage/cli 0.36.0 and fix test incompatibilities for Jest 30 and JSDOM 27. Signed-off-by: Jon Koops <jonkoops@gmail.com>
1 parent 25eed34 commit c23f23d

5 files changed

Lines changed: 2092 additions & 156 deletions

File tree

workspaces/orchestrator/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
"@backstage/repo-tools": "^0.17.0",
4646
"@changesets/cli": "^2.27.1",
4747
"@ianvs/prettier-plugin-sort-imports": "^4.4.0",
48+
"@jest/environment-jsdom-abstract": "^30.3.0",
49+
"@types/jest": "^30.0.0",
50+
"@types/jsdom": "^27.0.0",
51+
"jest": "^30.3.0",
52+
"jsdom": "^27.1.0",
4853
"knip": "^5.40.0",
4954
"node-gyp": "^9.0.0",
5055
"prettier": "3.8.3",

workspaces/orchestrator/plugins/orchestrator-backend/src/service/DataIndexService.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ describe('initInputArgs', () => {
174174
describe('fetchWorkflowInfos', () => {
175175
let loggerMock: LoggerService;
176176
let buildFilterConditionSpy: any;
177-
let buildGraphQlQuerySpy: jest.SpyInstance;
177+
let buildGraphQlQuerySpy: jest.Spied<
178+
typeof buildGrahQLQueryUtils.buildGraphQlQuery
179+
>;
178180
let dataIndexService: DataIndexService;
179181
let mockClient: jest.Mocked<Client>;
180182

workspaces/orchestrator/plugins/orchestrator-backend/src/service/SonataFlowService.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { DataIndexService } from './DataIndexService';
2121
import { SonataFlowService } from './SonataFlowService';
2222

2323
jest.mock('node:crypto', () => ({
24+
...jest.requireActual('node:crypto'),
2425
randomUUID: () => '12345',
2526
}));
2627

workspaces/orchestrator/plugins/orchestrator/src/api/OrchestratorClient.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ describe('OrchestratorClient', () => {
118118
const getExpectations = (
119119
result: any,
120120
mockExecResponse: ExecuteWorkflowResponseDTO,
121-
executeWorkflowSpy: jest.SpyInstance,
121+
executeWorkflowSpy: jest.Spied<
122+
typeof DefaultApi.prototype.executeWorkflow
123+
>,
122124
parameters: JsonObject,
123125
) => {
124126
return () => {

0 commit comments

Comments
 (0)