diff --git a/.eslintrc b/.eslintrc index 0dea940..1dde8ce 100644 --- a/.eslintrc +++ b/.eslintrc @@ -23,5 +23,11 @@ "import/extensions": [ ".mjs", ".cjs", ".js", ".json", ".jsx" ] - } + }, + "overrides": [ + { + "files": ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"], + "extends": ["./configs/jest/jest-eslint.config.js"] + } + ] } diff --git a/configs/jest/jest-eslint.config.js b/configs/jest/jest-eslint.config.js new file mode 100644 index 0000000..621a97a --- /dev/null +++ b/configs/jest/jest-eslint.config.js @@ -0,0 +1,14 @@ +module.exports = { + plugins: [ + 'jest', + 'jest-dom', + 'jest-formatting', + 'testing-library', + ], + extends: [ + 'plugin:jest/recommended', + 'plugin:jest-dom/recommended', + 'plugin:jest-formatting/recommended', + 'plugin:testing-library/react', + ], +}; diff --git a/offline_node_modules/@typescript-eslint-scope-manager-5.62.0.tgz b/offline_node_modules/@typescript-eslint-scope-manager-5.62.0.tgz new file mode 100644 index 0000000..41261ee Binary files /dev/null and b/offline_node_modules/@typescript-eslint-scope-manager-5.62.0.tgz differ diff --git a/offline_node_modules/@typescript-eslint-types-5.62.0.tgz b/offline_node_modules/@typescript-eslint-types-5.62.0.tgz new file mode 100644 index 0000000..5feaf90 Binary files /dev/null and b/offline_node_modules/@typescript-eslint-types-5.62.0.tgz differ diff --git a/offline_node_modules/@typescript-eslint-typescript-estree-5.62.0.tgz b/offline_node_modules/@typescript-eslint-typescript-estree-5.62.0.tgz new file mode 100644 index 0000000..0cc3bc3 Binary files /dev/null and b/offline_node_modules/@typescript-eslint-typescript-estree-5.62.0.tgz differ diff --git a/offline_node_modules/@typescript-eslint-utils-5.62.0.tgz b/offline_node_modules/@typescript-eslint-utils-5.62.0.tgz new file mode 100644 index 0000000..98fe748 Binary files /dev/null and b/offline_node_modules/@typescript-eslint-utils-5.62.0.tgz differ diff --git a/offline_node_modules/@typescript-eslint-visitor-keys-5.62.0.tgz b/offline_node_modules/@typescript-eslint-visitor-keys-5.62.0.tgz new file mode 100644 index 0000000..5e0cbc8 Binary files /dev/null and b/offline_node_modules/@typescript-eslint-visitor-keys-5.62.0.tgz differ diff --git a/offline_node_modules/eslint-plugin-jest-27.9.0.tgz b/offline_node_modules/eslint-plugin-jest-27.9.0.tgz new file mode 100644 index 0000000..fffe4c5 Binary files /dev/null and b/offline_node_modules/eslint-plugin-jest-27.9.0.tgz differ diff --git a/offline_node_modules/eslint-plugin-jest-dom-5.2.0.tgz b/offline_node_modules/eslint-plugin-jest-dom-5.2.0.tgz new file mode 100644 index 0000000..955ed23 Binary files /dev/null and b/offline_node_modules/eslint-plugin-jest-dom-5.2.0.tgz differ diff --git a/offline_node_modules/eslint-plugin-jest-formatting-3.1.0.tgz b/offline_node_modules/eslint-plugin-jest-formatting-3.1.0.tgz new file mode 100644 index 0000000..5762282 Binary files /dev/null and b/offline_node_modules/eslint-plugin-jest-formatting-3.1.0.tgz differ diff --git a/offline_node_modules/eslint-plugin-testing-library-6.2.0.tgz b/offline_node_modules/eslint-plugin-testing-library-6.2.0.tgz new file mode 100644 index 0000000..64ea8ec Binary files /dev/null and b/offline_node_modules/eslint-plugin-testing-library-6.2.0.tgz differ diff --git a/offline_node_modules/requireindex-1.2.0.tgz b/offline_node_modules/requireindex-1.2.0.tgz new file mode 100644 index 0000000..d7cc320 Binary files /dev/null and b/offline_node_modules/requireindex-1.2.0.tgz differ diff --git a/offline_node_modules/tslib-1.14.1.tgz b/offline_node_modules/tslib-1.14.1.tgz new file mode 100644 index 0000000..7ee2735 Binary files /dev/null and b/offline_node_modules/tslib-1.14.1.tgz differ diff --git a/offline_node_modules/tsutils-3.21.0.tgz b/offline_node_modules/tsutils-3.21.0.tgz new file mode 100644 index 0000000..509e73d Binary files /dev/null and b/offline_node_modules/tsutils-3.21.0.tgz differ diff --git a/package.json b/package.json index 1b3823d..79b3d49 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,10 @@ "@types/jest": "^29.5.12", "eslint": "8.57.0", "eslint-config-ksv741": "^0.0.1", + "eslint-plugin-jest": "^27.9.0", + "eslint-plugin-jest-dom": "^5.2.0", + "eslint-plugin-jest-formatting": "^3.1.0", + "eslint-plugin-testing-library": "^6.2.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "ksv741-react-scripts": "^0.1.0" diff --git a/src/apps/MoneyControllApp/ui/MoneyControllApp.spec.jsx b/src/apps/MoneyControllApp/ui/MoneyControllApp.spec.jsx index 71cac87..c6749a7 100644 --- a/src/apps/MoneyControllApp/ui/MoneyControllApp.spec.jsx +++ b/src/apps/MoneyControllApp/ui/MoneyControllApp.spec.jsx @@ -2,7 +2,7 @@ import { screen, render } from '@testing-library/react'; import MoneyControllApp from './MoneyControllApp.ui'; describe('Test MoneyControllApp', () => { - test('Test render', () => { + test('Render MoneyControllApp', () => { render(); const appElem = screen.getByTestId('money-contoll-app'); diff --git a/yarn.lock b/yarn.lock index 11e532c..8b4bbc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1146,7 +1146,7 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.12.5", "@babel/runtime@^7.23.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.23.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": version "7.24.1" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.1.tgz#431f9a794d173b53720e69a6464abc6f0e2a5c57" integrity sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ== @@ -2611,7 +2611,7 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.8.tgz#ce5ace04cfeabe7ef87c0091e50752e36707deff" integrity sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A== -"@types/semver@^7.5.0": +"@types/semver@^7.3.12", "@types/semver@^7.5.0": version "7.5.8" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== @@ -2758,6 +2758,14 @@ "@typescript-eslint/visitor-keys" "6.20.0" debug "^4.3.4" +"@typescript-eslint/scope-manager@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c" + integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== + dependencies: + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" + "@typescript-eslint/scope-manager@6.20.0": version "6.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz#8a926e60f6c47feb5bab878246dc2ae465730151" @@ -2784,6 +2792,11 @@ debug "^4.3.4" ts-api-utils "^1.0.1" +"@typescript-eslint/types@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" + integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== + "@typescript-eslint/types@6.20.0": version "6.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.20.0.tgz#5ccd74c29011ae7714ae6973e4ec0c634708b448" @@ -2794,6 +2807,19 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== +"@typescript-eslint/typescript-estree@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" + integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== + dependencies: + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + "@typescript-eslint/typescript-estree@6.20.0": version "6.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz#5b2d0975949e6bdd8d45ee1471461ef5fadc5542" @@ -2835,6 +2861,20 @@ "@typescript-eslint/typescript-estree" "6.20.0" semver "^7.5.4" +"@typescript-eslint/utils@^5.10.0", "@typescript-eslint/utils@^5.58.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86" + integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/typescript-estree" "5.62.0" + eslint-scope "^5.1.1" + semver "^7.3.7" + "@typescript-eslint/utils@^6.19.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" @@ -2848,6 +2888,14 @@ "@typescript-eslint/typescript-estree" "6.21.0" semver "^7.5.4" +"@typescript-eslint/visitor-keys@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" + integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== + dependencies: + "@typescript-eslint/types" "5.62.0" + eslint-visitor-keys "^3.3.0" + "@typescript-eslint/visitor-keys@6.20.0": version "6.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz#f7ada27f2803de89df0edd9fd7be22c05ce6a498" @@ -4748,6 +4796,26 @@ eslint-plugin-import@2.29.1: semver "^6.3.1" tsconfig-paths "^3.15.0" +eslint-plugin-jest-dom@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest-dom/-/eslint-plugin-jest-dom-5.2.0.tgz#81abac31683195251683229b0796311c1529d90e" + integrity sha512-ctnCP0MsLmUvbCyhnOQ+/1OmsZj+e7V6kFunazIx5728Yq7TQnuKI8HOsgPTStB+9iYEpiEa+VfKB09Lq7/3fA== + dependencies: + "@babel/runtime" "^7.16.3" + requireindex "^1.2.0" + +eslint-plugin-jest-formatting@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest-formatting/-/eslint-plugin-jest-formatting-3.1.0.tgz#b26dd5a40f432b642dcc880021a771bb1c93dcd2" + integrity sha512-XyysraZ1JSgGbLSDxjj5HzKKh0glgWf+7CkqxbTqb7zEhW7X2WHo5SBQ8cGhnszKN+2Lj3/oevBlHNbHezoc/A== + +eslint-plugin-jest@^27.9.0: + version "27.9.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.9.0.tgz#7c98a33605e1d8b8442ace092b60e9919730000b" + integrity sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug== + dependencies: + "@typescript-eslint/utils" "^5.10.0" + eslint-plugin-jsx-a11y@6.8.0: version "6.8.0" resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz#2fa9c701d44fcd722b7c771ec322432857fcbad2" @@ -4797,7 +4865,14 @@ eslint-plugin-react@7.33.2: semver "^6.3.1" string.prototype.matchall "^4.0.8" -eslint-scope@5.1.1: +eslint-plugin-testing-library@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-6.2.0.tgz#af3340b783c881eb19ec5ac6b3a4bfe8ab4a1f74" + integrity sha512-+LCYJU81WF2yQ+Xu4A135CgK8IszcFcyMF4sWkbiu6Oj+Nel0TrkZq/HvDw0/1WuO3dhDQsZA/OpEMGd0NfcUw== + dependencies: + "@typescript-eslint/utils" "^5.58.0" + +eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -8125,6 +8200,11 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== +requireindex@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" + integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== + requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -8321,7 +8401,7 @@ semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.4, semver@^7.3.5, semver@^7.5.3, semver@^7.5.4: +semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: version "7.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== @@ -8947,11 +9027,23 @@ tsconfig-paths@^4.1.2: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + tslib@^2.0.0, tslib@^2.0.3: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"