Skip to content

Commit

Permalink
fix jest
Browse files Browse the repository at this point in the history
  • Loading branch information
Ad96el committed Oct 10, 2023
1 parent ba59b45 commit 271277c
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 7 deletions.
11 changes: 8 additions & 3 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
clearMocks: true,
resolver: 'ts-jest-resolver',
// Parachain block time is 12s
testTimeout: 12000,
collectCoverageFrom: ['**/*/src/**/*.ts'],
rootDir: 'src',
coverageDirectory: 'coverage',
moduleDirectories: ['node_modules'],
moduleFileExtensions: ['js', 'ts', 'tsx', 'json', 'node'],
modulePaths: ['<rootDir>'],
moduleDirectories: [ 'dist', 'node_modules'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.cjs.json'
}
},

}
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"types": "./dist/cjs/index.d.ts",
"type": "module",
"exports": {
"." : {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"default": "./dist/cjs/index.js"
},
"./wellKnownDidConfiguration" : {
"./wellKnownDidConfiguration": {
"import": "./dist/esm/wellKnownDidConfiguration/index.js",
"require": "./dist/cjs/wellKnownDidConfiguration/index.js",
"default": "./dist/cjs/wellKnownDidConfiguration/index.js"
Expand All @@ -31,14 +31,19 @@
"default": "./dist/cjs/quote/index.js"
}
},
"files": [ "LICENSE", "README.md", "package.json", "dist"],
"files": [
"LICENSE",
"README.md",
"package.json",
"dist"
],
"author": "KILT <[email protected]>",
"license": "BSD-4-Clause",
"scripts": {
"lint": "eslint --ext .ts .",
"build": "yarn build:cjs && yarn build:esm",
"build:cjs": "tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
"build:esm": "tsc -p tsconfig.json && echo '{\"type\": \"module\"}' > dist/esm/package.json",
"build:esm": "tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > dist/esm/package.json",
"clean": "exec git clean -xf -e 'node_modules' '*'",
"test": "jest test --no-cache"
},
Expand All @@ -52,6 +57,7 @@
},
"devDependencies": {
"@polkadot/util-crypto": "^12.3.2",
"ts-jest-resolver": "^2.0.1",
"@types/jest": "^28.0.0",
"@types/node": "^18.8.2",
"@types/react": "^18.0.21",
Expand Down
File renamed without changes.
123 changes: 123 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,13 @@
dependencies:
"@sinclair/typebox" "^0.24.1"

"@jest/schemas@^29.6.3":
version "29.6.3"
resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03"
integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==
dependencies:
"@sinclair/typebox" "^0.27.8"

"@jest/source-map@^28.1.2":
version "28.1.2"
resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-28.1.2.tgz"
Expand Down Expand Up @@ -552,6 +559,18 @@
"@types/yargs" "^17.0.8"
chalk "^4.0.0"

"@jest/types@^29.6.3":
version "29.6.3"
resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59"
integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==
dependencies:
"@jest/schemas" "^29.6.3"
"@types/istanbul-lib-coverage" "^2.0.0"
"@types/istanbul-reports" "^3.0.0"
"@types/node" "*"
"@types/yargs" "^17.0.8"
chalk "^4.0.0"

"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2":
version "0.3.3"
resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz"
Expand Down Expand Up @@ -1102,6 +1121,11 @@
resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.44.tgz"
integrity sha512-ka0W0KN5i6LfrSocduwliMMpqVgohtPFidKdMEOUjoOFCHcOOYkKsPRxfs5f15oPNHTm6ERAm0GV/+/LTKeiWg==

"@sinclair/typebox@^0.27.8":
version "0.27.8"
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e"
integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==

"@sinonjs/commons@^1.7.0":
version "1.8.3"
resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz"
Expand Down Expand Up @@ -2860,6 +2884,11 @@ jest-get-type@^28.0.2:
resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-28.0.2.tgz"
integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA==

jest-get-type@^29.6.3:
version "29.6.3"
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1"
integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==

jest-haste-map@^28.1.3:
version "28.1.3"
resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-28.1.3.tgz"
Expand All @@ -2879,6 +2908,25 @@ jest-haste-map@^28.1.3:
optionalDependencies:
fsevents "^2.3.2"

jest-haste-map@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104"
integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==
dependencies:
"@jest/types" "^29.6.3"
"@types/graceful-fs" "^4.1.3"
"@types/node" "*"
anymatch "^3.0.3"
fb-watchman "^2.0.0"
graceful-fs "^4.2.9"
jest-regex-util "^29.6.3"
jest-util "^29.7.0"
jest-worker "^29.7.0"
micromatch "^4.0.4"
walker "^1.0.8"
optionalDependencies:
fsevents "^2.3.2"

jest-leak-detector@^28.1.3:
version "28.1.3"
resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz"
Expand Down Expand Up @@ -2930,6 +2978,11 @@ jest-regex-util@^28.0.2:
resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-28.0.2.tgz"
integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw==

jest-regex-util@^29.6.3:
version "29.6.3"
resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52"
integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==

jest-resolve-dependencies@^28.1.3:
version "28.1.3"
resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.3.tgz"
Expand All @@ -2953,6 +3006,21 @@ jest-resolve@^28.1.3:
resolve.exports "^1.1.0"
slash "^3.0.0"

jest-resolve@^29.5.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30"
integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==
dependencies:
chalk "^4.0.0"
graceful-fs "^4.2.9"
jest-haste-map "^29.7.0"
jest-pnp-resolver "^1.2.2"
jest-util "^29.7.0"
jest-validate "^29.7.0"
resolve "^1.20.0"
resolve.exports "^2.0.0"
slash "^3.0.0"

jest-runner@^28.1.3:
version "28.1.3"
resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-28.1.3.tgz"
Expand Down Expand Up @@ -3049,6 +3117,18 @@ jest-util@^28.0.0, jest-util@^28.1.3:
graceful-fs "^4.2.9"
picomatch "^2.2.3"

jest-util@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc"
integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==
dependencies:
"@jest/types" "^29.6.3"
"@types/node" "*"
chalk "^4.0.0"
ci-info "^3.2.0"
graceful-fs "^4.2.9"
picomatch "^2.2.3"

jest-validate@^28.1.3:
version "28.1.3"
resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-28.1.3.tgz"
Expand All @@ -3061,6 +3141,18 @@ jest-validate@^28.1.3:
leven "^3.1.0"
pretty-format "^28.1.3"

jest-validate@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c"
integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==
dependencies:
"@jest/types" "^29.6.3"
camelcase "^6.2.0"
chalk "^4.0.0"
jest-get-type "^29.6.3"
leven "^3.1.0"
pretty-format "^29.7.0"

jest-watcher@^28.1.3:
version "28.1.3"
resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-28.1.3.tgz"
Expand All @@ -3084,6 +3176,16 @@ jest-worker@^28.1.3:
merge-stream "^2.0.0"
supports-color "^8.0.0"

jest-worker@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a"
integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==
dependencies:
"@types/node" "*"
jest-util "^29.7.0"
merge-stream "^2.0.0"
supports-color "^8.0.0"

jest@^28.0.0:
version "28.1.3"
resolved "https://registry.npmjs.org/jest/-/jest-28.1.3.tgz"
Expand Down Expand Up @@ -3619,6 +3721,15 @@ pretty-format@^28.0.0, pretty-format@^28.1.3:
ansi-styles "^5.0.0"
react-is "^18.0.0"

pretty-format@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812"
integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==
dependencies:
"@jest/schemas" "^29.6.3"
ansi-styles "^5.0.0"
react-is "^18.0.0"

process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz"
Expand Down Expand Up @@ -3779,6 +3890,11 @@ resolve.exports@^1.1.0:
resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz"
integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==

resolve.exports@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800"
integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==

resolve@^1.20.0:
version "1.22.1"
resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz"
Expand Down Expand Up @@ -4176,6 +4292,13 @@ tr46@~0.0.3:
resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz"
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==

ts-jest-resolver@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/ts-jest-resolver/-/ts-jest-resolver-2.0.1.tgz#4a1563cb10967e17eaae04157b0ba34e24d1c247"
integrity sha512-FolE73BqVZCs8/RbLKxC67iaAtKpBWx7PeLKFW2zJQlOf9j851I7JRxSDenri2NFvVH3QP7v3S8q1AmL24Zb9Q==
dependencies:
jest-resolve "^29.5.0"

ts-jest@^28.0.8:
version "28.0.8"
resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-28.0.8.tgz"
Expand Down

0 comments on commit 271277c

Please sign in to comment.