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 e219477
Show file tree
Hide file tree
Showing 4 changed files with 187 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
167 changes: 165 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,15 @@ __metadata:
languageName: node
linkType: hard

"@jest/create-cache-key-function@npm:^29.7.0":
version: 29.7.0
resolution: "@jest/create-cache-key-function@npm:29.7.0"
dependencies:
"@jest/types": ^29.6.3
checksum: 681bc761fa1d6fa3dd77578d444f97f28296ea80755e90e46d1c8fa68661b9e67f54dd38b988742db636d26cf160450dc6011892cec98b3a7ceb58cad8ff3aae
languageName: node
linkType: hard

"@jest/environment@npm:^29.7.0":
version: 29.7.0
resolution: "@jest/environment@npm:29.7.0"
Expand Down Expand Up @@ -2455,6 +2464,8 @@ __metadata:
"@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 Down Expand Up @@ -2487,7 +2498,7 @@ __metadata:
eslint-plugin-react-hooks: ^4.6.0
eslint-plugin-react-refresh: ^0.4.3
html-to-image: ^1.11.11
jest: ^29.4.2
jest: ^29.7.0
jest-canvas-mock: ^2.5.2
jest-environment-jsdom: ^29.4.2
lodash.clonedeep: ^4.5.0
Expand Down Expand Up @@ -4415,6 +4426,151 @@ __metadata:
languageName: node
linkType: hard

"@swc/core-darwin-arm64@npm:1.7.14":
version: 1.7.14
resolution: "@swc/core-darwin-arm64@npm:1.7.14"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@swc/core-darwin-x64@npm:1.7.14":
version: 1.7.14
resolution: "@swc/core-darwin-x64@npm:1.7.14"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@swc/core-linux-arm-gnueabihf@npm:1.7.14":
version: 1.7.14
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.7.14"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard

"@swc/core-linux-arm64-gnu@npm:1.7.14":
version: 1.7.14
resolution: "@swc/core-linux-arm64-gnu@npm:1.7.14"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-arm64-musl@npm:1.7.14":
version: 1.7.14
resolution: "@swc/core-linux-arm64-musl@npm:1.7.14"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@swc/core-linux-x64-gnu@npm:1.7.14":
version: 1.7.14
resolution: "@swc/core-linux-x64-gnu@npm:1.7.14"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-x64-musl@npm:1.7.14":
version: 1.7.14
resolution: "@swc/core-linux-x64-musl@npm:1.7.14"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@swc/core-win32-arm64-msvc@npm:1.7.14":
version: 1.7.14
resolution: "@swc/core-win32-arm64-msvc@npm:1.7.14"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@swc/core-win32-ia32-msvc@npm:1.7.14":
version: 1.7.14
resolution: "@swc/core-win32-ia32-msvc@npm:1.7.14"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard

"@swc/core-win32-x64-msvc@npm:1.7.14":
version: 1.7.14
resolution: "@swc/core-win32-x64-msvc@npm:1.7.14"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@swc/core@npm:^1.7.14":
version: 1.7.14
resolution: "@swc/core@npm:1.7.14"
dependencies:
"@swc/core-darwin-arm64": 1.7.14
"@swc/core-darwin-x64": 1.7.14
"@swc/core-linux-arm-gnueabihf": 1.7.14
"@swc/core-linux-arm64-gnu": 1.7.14
"@swc/core-linux-arm64-musl": 1.7.14
"@swc/core-linux-x64-gnu": 1.7.14
"@swc/core-linux-x64-musl": 1.7.14
"@swc/core-win32-arm64-msvc": 1.7.14
"@swc/core-win32-ia32-msvc": 1.7.14
"@swc/core-win32-x64-msvc": 1.7.14
"@swc/counter": ^0.1.3
"@swc/types": ^0.1.12
peerDependencies:
"@swc/helpers": "*"
dependenciesMeta:
"@swc/core-darwin-arm64":
optional: true
"@swc/core-darwin-x64":
optional: true
"@swc/core-linux-arm-gnueabihf":
optional: true
"@swc/core-linux-arm64-gnu":
optional: true
"@swc/core-linux-arm64-musl":
optional: true
"@swc/core-linux-x64-gnu":
optional: true
"@swc/core-linux-x64-musl":
optional: true
"@swc/core-win32-arm64-msvc":
optional: true
"@swc/core-win32-ia32-msvc":
optional: true
"@swc/core-win32-x64-msvc":
optional: true
peerDependenciesMeta:
"@swc/helpers":
optional: true
checksum: cc05a42f478d5ad3e177ecb3f1d79532d0746be0027a7adda9badfbe0050aa01fdc6b27bcf62ff3e840d071cb4c57d6ff5321f8b3d94b95ebfbb786d63c2cb9a
languageName: node
linkType: hard

"@swc/counter@npm:^0.1.3":
version: 0.1.3
resolution: "@swc/counter@npm:0.1.3"
checksum: df8f9cfba9904d3d60f511664c70d23bb323b3a0803ec9890f60133954173047ba9bdeabce28cd70ba89ccd3fd6c71c7b0bd58be85f611e1ffbe5d5c18616598
languageName: node
linkType: hard

"@swc/jest@npm:^0.2.36":
version: 0.2.36
resolution: "@swc/jest@npm:0.2.36"
dependencies:
"@jest/create-cache-key-function": ^29.7.0
"@swc/counter": ^0.1.3
jsonc-parser: ^3.2.0
peerDependencies:
"@swc/core": "*"
checksum: 14f2e696ac093e23dae1e2e57d894bbcde4de6fe80341a26c8d0d8cbae5aae31832f8fa32dc698529f128d19a76aeedf2227f59480de6dab5eb3f30bfdf9b71a
languageName: node
linkType: hard

"@swc/types@npm:^0.1.12":
version: 0.1.12
resolution: "@swc/types@npm:0.1.12"
dependencies:
"@swc/counter": ^0.1.3
checksum: cf7f89e46f859864075d7965582baea9c5f98830f45b1046251568c9bdf1ca484b1bf37f6d3c32b7c82ecf8cd5df89d22f05268c391819c44e49911bb1a8e71a
languageName: node
linkType: hard

"@testing-library/dom@npm:10.1.0, @testing-library/dom@npm:^10.0.0":
version: 10.1.0
resolution: "@testing-library/dom@npm:10.1.0"
Expand Down Expand Up @@ -11717,7 +11873,7 @@ __metadata:
languageName: node
linkType: hard

"jest@npm:^29.4.2":
"jest@npm:^29.7.0":
version: 29.7.0
resolution: "jest@npm:29.7.0"
dependencies:
Expand Down Expand Up @@ -11997,6 +12153,13 @@ __metadata:
languageName: node
linkType: hard

"jsonc-parser@npm:^3.2.0":
version: 3.3.1
resolution: "jsonc-parser@npm:3.3.1"
checksum: 81ef19d98d9c6bd6e4a37a95e2753c51c21705cbeffd895e177f4b542cca9cda5fda12fb942a71a2e824a9132cf119dc2e642e9286386055e1365b5478f49a47
languageName: node
linkType: hard

"jsonfile@npm:^4.0.0":
version: 4.0.0
resolution: "jsonfile@npm:4.0.0"
Expand Down

0 comments on commit e219477

Please sign in to comment.