Skip to content

Commit

Permalink
perf(jest): remove ts-jest
Browse files Browse the repository at this point in the history
  • Loading branch information
escapedcat committed Jun 30, 2022
1 parent 5c2c05e commit 894e5ed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 59 deletions.
19 changes: 11 additions & 8 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { pathsToModuleNameMapper } from "ts-jest";

import { compilerOptions } from "./tsconfig.json";

module.exports = {
verbose: true,
transform: {
"^.+\\.mjs?$": [ // "dexie" needs this
"^.+\\.mjs?$": [
// "dexie" needs this
"@swc/jest",
{
jsc: {
Expand All @@ -15,6 +12,7 @@ module.exports = {
},
},
},
target: "es2016",
},
],
"^.+\\.(t|j)sx?$": [
Expand All @@ -26,14 +24,19 @@ module.exports = {
runtime: "automatic",
},
},
target: "es2016",
},
},
],
},
transformIgnorePatterns: ["node_modules/(?!(@runcitadel))/"],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: "<rootDir>/",
}),
moduleNameMapper: {
// needs to align with "tsconfig.json"-paths
// swc does not provide "pathsToModuleNameMapper" as ts-jest does
"^~/(.*)$": "<rootDir>/src/$1",
"^@components/(.*)$": "<rootDir>/src/app/components/$1",
"^@screens/(.*)$": "<rootDir>/src/app/screens/$1",
},
setupFiles: ["jest-webextension-mock", "fake-indexeddb/auto"],
testEnvironment: "./jest.custom-test-environment.ts",
setupFilesAfterEnv: ["./jest.setup.ts"],
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
"sass-loader": "^13.0.0",
"stream-browserify": "^3.0.0",
"terser-webpack-plugin": "^5.3.3",
"ts-jest": "^28.0.4",
"ts-node": "^10.8.1",
"tsconfig-paths-webpack-plugin": "^3.5.2",
"typescript": "^4.7.4",
Expand Down
55 changes: 5 additions & 50 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2812,18 +2812,6 @@
"@types/yargs" "^16.0.0"
chalk "^4.0.0"

"@jest/types@^28.1.0":
version "28.1.0"
resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.0.tgz#508327a89976cbf9bd3e1cc74641a29fd7dfd519"
integrity sha512-xmEggMPr317MIOjjDoZ4ejCSr9Lpbt/u34+dvc99t7DS8YirW5rwZEhzKPC2BMUFkUhI48qs6qLUSGw5FuL0GA==
dependencies:
"@jest/schemas" "^28.0.2"
"@types/istanbul-lib-coverage" "^2.0.0"
"@types/istanbul-reports" "^3.0.0"
"@types/node" "*"
"@types/yargs" "^17.0.8"
chalk "^4.0.0"

"@jest/types@^28.1.1":
version "28.1.1"
resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.1.tgz#d059bbc80e6da6eda9f081f293299348bd78ee0b"
Expand Down Expand Up @@ -6665,13 +6653,6 @@ browserslist@^4.16.6, browserslist@^4.20.2, browserslist@^4.20.3:
node-releases "^2.0.3"
picocolors "^1.0.0"

[email protected]:
version "0.2.6"
resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8"
integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==
dependencies:
fast-json-stable-stringify "2.x"

bs58@^4.0.0:
version "4.0.1"
resolved "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz"
Expand Down Expand Up @@ -9247,7 +9228,7 @@ fast-json-parse@^1.0.3:
resolved "https://registry.npmjs.org/fast-json-parse/-/fast-json-parse-1.0.3.tgz"
integrity sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==

fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0:
fast-json-stable-stringify@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
Expand Down Expand Up @@ -11749,18 +11730,6 @@ jest-util@^26.6.2:
is-ci "^2.0.0"
micromatch "^4.0.2"

jest-util@^28.0.0:
version "28.1.0"
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.0.tgz#d54eb83ad77e1dd441408738c5a5043642823be5"
integrity sha512-qYdCKD77k4Hwkose2YBEqQk7PzUf/NSE+rutzceduFveQREeH6b+89Dc9+wjX9dAwHcgdx4yedGA3FQlU/qCTA==
dependencies:
"@jest/types" "^28.1.0"
"@types/node" "*"
chalk "^4.0.0"
ci-info "^3.2.0"
graceful-fs "^4.2.9"
picomatch "^2.2.3"

jest-util@^28.1.1:
version "28.1.1"
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.1.tgz#ff39e436a1aca397c0ab998db5a51ae2b7080d05"
Expand Down Expand Up @@ -12316,7 +12285,7 @@ lodash.isplainobject@^4.0.6:
resolved "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz"
integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=

lodash.memoize@4.x, lodash.memoize@^4.1.2:
lodash.memoize@^4.1.2:
version "4.1.2"
resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz"
integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=
Expand Down Expand Up @@ -12438,7 +12407,7 @@ make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0:
dependencies:
semver "^6.0.0"

make-error@1.x, make-error@^1.1.1:
make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
Expand Down Expand Up @@ -15757,7 +15726,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==

[email protected], semver@7.x, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7:
[email protected], semver@^7.3.4, semver@^7.3.5, semver@^7.3.7:
version "7.3.7"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
Expand Down Expand Up @@ -17087,20 +17056,6 @@ ts-dedent@^2.0.0:
resolved "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.1.1.tgz"
integrity sha512-riHuwnzAUCfdIeTBNUq7+Yj+ANnrMXo/7+Z74dIdudS7ys2k8aSGMzpJRMFDF7CLwUTbtvi1ZZff/Wl+XxmqIA==

ts-jest@^28.0.4:
version "28.0.4"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-28.0.4.tgz#0ab705a60fc4b9f3506f35e26edfa9e9c915c31b"
integrity sha512-S6uRDDdCJBvnZqyGjB4VCnwbQrbgdL8WPeP4jevVSpYsBaeGRQAIS08o3Svav2Ex+oXwLgJ/m7F24TNq62kA1A==
dependencies:
bs-logger "0.x"
fast-json-stable-stringify "2.x"
jest-util "^28.0.0"
json5 "^2.2.1"
lodash.memoize "4.x"
make-error "1.x"
semver "7.x"
yargs-parser "^20.x"

ts-node@^10.7.0:
version "10.7.0"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5"
Expand Down Expand Up @@ -18409,7 +18364,7 @@ yaml@^2.1.1:
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.1.1.tgz#1e06fb4ca46e60d9da07e4f786ea370ed3c3cfec"
integrity sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==

yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.7, yargs-parser@^20.x:
yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.7:
version "20.2.9"
resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz"
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
Expand Down

0 comments on commit 894e5ed

Please sign in to comment.