Skip to content

Commit

Permalink
chore(test): Add @swc/jest to reduce heap usage
Browse files Browse the repository at this point in the history
  • Loading branch information
lordrip committed Aug 20, 2024
1 parent a348f85 commit b5b069d
Show file tree
Hide file tree
Showing 6 changed files with 251 additions and 3 deletions.
15 changes: 15 additions & 0 deletions packages/ui/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"jsc": {
"transform": {
"react": {
"runtime": "automatic"
}
},
"parser": {
"syntax": "typescript",
"tsx": true,
"decorators": false,
"dynamicImport": false
}
}
}
4 changes: 4 additions & 0 deletions packages/ui/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ export default {

// A map from regular expressions to paths to transformers
// transform: undefined,
transform: {
'^.+\\.(t|j)sx?$': '@swc/jest',
},
extensionsToTreatAsEsm: ['.ts', '.tsx'],

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
transformIgnorePatterns: [
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
"@patternfly/react-icons": "5.3.2",
"@patternfly/react-table": "5.3.4",
"@patternfly/react-topology": "5.4.0-prerelease.13",
"@swc/core": "^1.7.14",
"@swc/jest": "^0.2.36",
"@testing-library/dom": "^10.0.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^16.0.0",
Expand All @@ -125,7 +127,7 @@
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"jest": "^29.4.2",
"jest": "^29.7.0",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^29.4.2",
"monaco-yaml": "^5.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a group wi
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "child1-1234",
"nextNode": undefined,
Expand Down Expand Up @@ -42,6 +43,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a group wi
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "child2-1234",
"nextNode": undefined,
Expand Down Expand Up @@ -80,6 +82,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a group wi
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "child2-1234",
"nextNode": undefined,
Expand All @@ -106,6 +109,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a group wi
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "child1-1234",
"nextNode": undefined,
Expand Down Expand Up @@ -161,6 +165,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a group wi
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "child1-1234",
"nextNode": undefined,
Expand All @@ -178,6 +183,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a group wi
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "child2-1234",
"nextNode": undefined,
Expand Down Expand Up @@ -223,6 +229,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a multiple
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "node-1234",
"nextNode": VisualizationNode {
Expand All @@ -236,6 +243,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a multiple
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "set-header-1234",
"nextNode": VisualizationNode {
Expand Down Expand Up @@ -273,6 +281,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a multiple
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "when-leaf-1234",
"nextNode": undefined,
Expand Down Expand Up @@ -321,6 +330,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a multiple
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "log-1234",
"nextNode": undefined,
Expand Down Expand Up @@ -355,6 +365,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a multiple
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "direct-1234",
"nextNode": undefined,
Expand Down Expand Up @@ -408,6 +419,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a simple V
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "node-1234",
"nextNode": undefined,
Expand Down Expand Up @@ -454,6 +466,7 @@ exports[`FlowService getFlowDiagram should return nodes and edges for a two-node
"canRemoveStep": false,
"canReplaceStep": false,
},
"children": undefined,
"data": {},
"id": "child-1234",
"nextNode": undefined,
Expand Down
Loading

0 comments on commit b5b069d

Please sign in to comment.