From cc0f4b03fb62426980935e38462ffa7312eb68e4 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Mon, 30 Oct 2023 23:08:25 +0800 Subject: [PATCH 01/26] Add jest to tests/package.json --- tests/.gitignore | 1 + tests/package.json | 5 + tests/yarn.lock | 2146 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2152 insertions(+) create mode 100644 tests/.gitignore create mode 100644 tests/package.json create mode 100644 tests/yarn.lock diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 00000000..30bc1627 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +/node_modules \ No newline at end of file diff --git a/tests/package.json b/tests/package.json new file mode 100644 index 00000000..24790211 --- /dev/null +++ b/tests/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "jest": "^29.7.0" + } +} diff --git a/tests/yarn.lock b/tests/yarn.lock new file mode 100644 index 00000000..4772fcb9 --- /dev/null +++ b/tests/yarn.lock @@ -0,0 +1,2146 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ampproject/remapping@^2.2.0": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" + integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.13": + version "7.22.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" + integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== + dependencies: + "@babel/highlight" "^7.22.13" + chalk "^2.4.2" + +"@babel/compat-data@^7.22.9": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.2.tgz#6a12ced93455827037bfb5ed8492820d60fc32cc" + integrity sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ== + +"@babel/core@^7.11.6", "@babel/core@^7.12.3": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.2.tgz#ed10df0d580fff67c5f3ee70fd22e2e4c90a9f94" + integrity sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.23.0" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-module-transforms" "^7.23.0" + "@babel/helpers" "^7.23.2" + "@babel/parser" "^7.23.0" + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.2" + "@babel/types" "^7.23.0" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/generator@^7.23.0", "@babel/generator@^7.7.2": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420" + integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g== + dependencies: + "@babel/types" "^7.23.0" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + +"@babel/helper-compilation-targets@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz#0698fc44551a26cf29f18d4662d5bf545a6cfc52" + integrity sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw== + dependencies: + "@babel/compat-data" "^7.22.9" + "@babel/helper-validator-option" "^7.22.15" + browserslist "^4.21.9" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== + +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== + dependencies: + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" + +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-module-imports@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" + integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== + dependencies: + "@babel/types" "^7.22.15" + +"@babel/helper-module-transforms@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz#3ec246457f6c842c0aee62a01f60739906f7047e" + integrity sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/helper-validator-identifier" "^7.22.20" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== + +"@babel/helper-simple-access@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" + integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + +"@babel/helper-validator-option@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" + integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== + +"@babel/helpers@^7.23.2": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.2.tgz#2832549a6e37d484286e15ba36a5330483cac767" + integrity sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ== + dependencies: + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.2" + "@babel/types" "^7.23.0" + +"@babel/highlight@^7.22.13": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" + integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" + integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== + +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-bigint@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" + integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-syntax-import-meta@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" + integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-jsx@^7.7.2": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" + integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-numeric-separator@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-top-level-await@^7.8.3": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-typescript@^7.7.2": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" + integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + +"@babel/template@^7.22.15", "@babel/template@^7.3.3": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== + dependencies: + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" + +"@babel/traverse@^7.23.2": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8" + integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw== + dependencies: + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.23.0" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.0" + "@babel/types" "^7.23.0" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.3.3": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" + integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + +"@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + +"@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== + dependencies: + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + ci-info "^3.2.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== + dependencies: + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== + dependencies: + jest-get-type "^29.6.3" + +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== + dependencies: + expect "^29.7.0" + jest-snapshot "^29.7.0" + +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== + dependencies: + "@jest/types" "^29.6.3" + "@sinonjs/fake-timers" "^10.0.2" + "@types/node" "*" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" + +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/types" "^29.6.3" + jest-mock "^29.7.0" + +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + "@types/node" "*" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^6.0.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.1.3" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" + slash "^3.0.0" + string-length "^4.0.1" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.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@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.18" + callsites "^3.0.0" + graceful-fs "^4.2.9" + +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== + dependencies: + "@jest/console" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== + dependencies: + "@jest/test-result" "^29.7.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + slash "^3.0.0" + +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.2" + +"@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.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.20" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" + integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@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@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.0.tgz#beb434fe875d965265e04722ccfc21df7f755d72" + integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^10.0.2": + version "10.3.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== + dependencies: + "@sinonjs/commons" "^3.0.0" + +"@types/babel__core@^7.1.14": + version "7.20.3" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.3.tgz#d5625a50b6f18244425a1359a858c73d70340778" + integrity sha512-54fjTSeSHwfan8AyHWrKbfBWiEUrNTZsUwPTDSNaaP1QDQIZbeNUg3a59E9D+375MzUw/x1vx2/0F5LBz+AeYA== + dependencies: + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.6.6" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.6.tgz#676f89f67dc8ddaae923f70ebc5f1fa800c031a8" + integrity sha512-66BXMKb/sUWbMdBNdMvajU7i/44RkrA3z/Yt1c7R5xejt8qh84iU54yUWCtm0QwGJlDcf/gg4zd/x4mpLAlb/w== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.3.tgz#db9ac539a2fe05cfe9e168b24f360701bde41f5f" + integrity sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.20.3" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.3.tgz#a971aa47441b28ef17884ff945d0551265a2d058" + integrity sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw== + dependencies: + "@babel/types" "^7.20.7" + +"@types/graceful-fs@^4.1.3": + version "4.1.8" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.8.tgz#417e461e4dc79d957dc3107f45fe4973b09c2915" + integrity sha512-NhRH7YzWq8WiNKVavKPBmtLYZHxNY19Hh+az28O/phfp68CF45pMFud+ZzJ8ewnxnC5smIdF3dqFeiSUQ5I+pw== + dependencies: + "@types/node" "*" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#fdfdd69fa16d530047d9963635bd77c71a08c068" + integrity sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ== + +"@types/istanbul-lib-report@*": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.2.tgz#394798d5f727402eb5ec99eb9618ffcd2b7645a1" + integrity sha512-8toY6FgdltSdONav1XtUHl4LN1yTmLza+EuDazb/fEmRNCwjyqNVIQWs2IfC74IqjHkREs/nQ2FWq5kZU9IC0w== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.3.tgz#0313e2608e6d6955d195f55361ddeebd4b74c6e7" + integrity sha512-1nESsePMBlf0RPRffLZi5ujYh7IH1BWL4y9pr+Bn3cJBdxz+RTP8bUFljLz9HvzhhOSWKdyBZ4DIivdL6rvgZg== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/node@*": + version "20.8.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.9.tgz#646390b4fab269abce59c308fc286dcd818a2b08" + integrity sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg== + dependencies: + undici-types "~5.26.4" + +"@types/stack-utils@^2.0.0": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.2.tgz#01284dde9ef4e6d8cef6422798d9a3ad18a66f8b" + integrity sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw== + +"@types/yargs-parser@*": + version "21.0.2" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.2.tgz#7bd04c5da378496ef1695a1008bf8f71847a8b8b" + integrity sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw== + +"@types/yargs@^17.0.8": + version "17.0.29" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.29.tgz#06aabc72497b798c643c812a8b561537fea760cf" + integrity sha512-nacjqA3ee9zRF/++a3FUY1suHTFKZeHba2n8WeDw9cCVdmzmHpIxyzOJBcpHvvEmS8E9KqWlSnWHUkOrkhWcvA== + dependencies: + "@types/yargs-parser" "*" + +ansi-escapes@^4.2.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + +anymatch@^3.0.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== + dependencies: + "@jest/transform" "^29.7.0" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.1.1" + babel-preset-jest "^29.6.3" + chalk "^4.0.0" + graceful-fs "^4.2.9" + slash "^3.0.0" + +babel-plugin-istanbul@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^5.0.4" + test-exclude "^6.0.0" + +babel-plugin-jest-hoist@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" + integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.1.14" + "@types/babel__traverse" "^7.0.6" + +babel-preset-current-node-syntax@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" + integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== + dependencies: + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-bigint" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.8.3" + "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-top-level-await" "^7.8.3" + +babel-preset-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" + integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== + dependencies: + babel-plugin-jest-hoist "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browserslist@^4.21.9: + version "4.22.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.1.tgz#ba91958d1a59b87dab6fed8dfbcb3da5e2e9c619" + integrity sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ== + dependencies: + caniuse-lite "^1.0.30001541" + electron-to-chromium "^1.4.535" + node-releases "^2.0.13" + update-browserslist-db "^1.0.13" + +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +caniuse-lite@^1.0.30001541: + version "1.0.30001558" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001558.tgz#d2c6e21fdbfe83817f70feab902421a19b7983ee" + integrity sha512-/Et7DwLqpjS47JPEcz6VnxU9PwcIdVi0ciLXRWBQdj1XFye68pSQYpV0QtPTfUKWuOaEig+/Vez2l74eDc1tPQ== + +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== + +ci-info@^3.2.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== + +cjs-module-lexer@^1.0.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" + integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== + +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== + +collect-v8-coverage@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" + integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" + +cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +debug@^4.1.0, debug@^4.1.1: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +dedent@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" + integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== + +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + +detect-newline@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== + +diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== + +electron-to-chromium@^1.4.535: + version "1.4.569" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.569.tgz#1298b67727187ffbaac005a7425490d157f3ad03" + integrity sha512-LsrJjZ0IbVy12ApW3gpYpcmHS3iRxH4bkKOW98y1/D+3cvDUWGcbzbsFinfUS8knpcZk/PG/2p/RnkMCYN7PVg== + +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== + +expect@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== + dependencies: + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + +fast-json-stable-stringify@^2.1.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== + +fb-watchman@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== + dependencies: + bser "2.1.1" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@^4.0.0, find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@^2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +glob@^7.1.3, glob@^7.1.4: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +graceful-fs@^4.2.9: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +hasown@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" + integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== + dependencies: + function-bind "^1.1.2" + +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +import-local@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" + integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + +is-core-module@^2.13.0: + version "2.13.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" + integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== + dependencies: + hasown "^2.0.0" + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" + integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + +istanbul-lib-instrument@^5.0.4: + version "5.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + +istanbul-lib-instrument@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz#71e87707e8041428732518c6fb5211761753fbdf" + integrity sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + +istanbul-lib-report@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^4.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.1.3: + version "3.1.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== + dependencies: + execa "^5.0.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^1.0.0" + is-generator-fn "^2.0.0" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + pretty-format "^29.7.0" + pure-rand "^6.0.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-cli@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== + dependencies: + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + chalk "^4.0.0" + create-jest "^29.7.0" + exit "^0.1.2" + import-local "^3.0.2" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + yargs "^17.3.1" + +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== + dependencies: + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.7.0" + "@jest/types" "^29.6.3" + babel-jest "^29.7.0" + chalk "^4.0.0" + ci-info "^3.2.0" + deepmerge "^4.2.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-json-comments "^3.1.1" + +jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== + dependencies: + detect-newline "^3.0.0" + +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + jest-get-type "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" + +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + jest-util "^29.7.0" + +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@^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@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== + dependencies: + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== + dependencies: + chalk "^4.0.0" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.6.3" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-util "^29.7.0" + +jest-pnp-resolver@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== + +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@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== + dependencies: + jest-regex-util "^29.6.3" + jest-snapshot "^29.7.0" + +jest-resolve@^29.7.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@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== + dependencies: + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.13.1" + graceful-fs "^4.2.9" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" + p-limit "^3.1.0" + source-map-support "0.5.13" + +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + strip-bom "^4.0.0" + +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== + dependencies: + "@babel/core" "^7.11.6" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^29.7.0" + graceful-fs "^4.2.9" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + natural-compare "^1.4.0" + pretty-format "^29.7.0" + semver "^7.5.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@^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@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== + dependencies: + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.13.1" + jest-util "^29.7.0" + string-length "^4.0.1" + +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@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== + dependencies: + "@jest/core" "^29.7.0" + "@jest/types" "^29.6.3" + import-local "^3.0.2" + jest-cli "^29.7.0" + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json5@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + +kleur@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== + +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== + dependencies: + tmpl "1.0.5" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== + +node-releases@^2.0.13: + version "2.0.13" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" + integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-json@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pirates@^4.0.4: + version "4.0.6" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== + +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.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" + +prompts@^2.0.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.5" + +pure-rand@^6.0.0: + version "6.0.4" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7" + integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA== + +react-is@^18.0.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +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.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +semver@^6.3.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.5.3, semver@^7.5.4: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +signal-exit@^3.0.3, signal-exit@^3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +sisteransi@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + +stack-utils@^2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== + dependencies: + escape-string-regexp "^2.0.0" + +string-length@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" + integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== + dependencies: + char-regex "^1.0.2" + strip-ansi "^6.0.0" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + +tmpl@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + +v8-to-istanbul@^9.0.1: + version "9.1.3" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz#ea456604101cd18005ac2cae3cdd1aa058a6306b" + integrity sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg== + dependencies: + "@jridgewell/trace-mapping" "^0.3.12" + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^2.0.0" + +walker@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== + dependencies: + makeerror "1.0.12" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +write-file-atomic@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + +yargs@^17.3.1: + version "17.7.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 7bacb802ab179d28edd72a5df9830fe3e10be154 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Wed, 1 Nov 2023 18:22:07 +0800 Subject: [PATCH 02/26] Add sample test files --- tests/SignUp.test.js | 10 ++++++++ tests/example.test.js | 9 +++++++ tests/package.json | 1 + tests/yarn.lock | 57 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 tests/SignUp.test.js create mode 100644 tests/example.test.js diff --git a/tests/SignUp.test.js b/tests/SignUp.test.js new file mode 100644 index 00000000..e2f873f8 --- /dev/null +++ b/tests/SignUp.test.js @@ -0,0 +1,10 @@ +const axios = require('axios'); + +test('Test something that requires authentication', async () => { + const response = await axios.post('http://peerpreptest.bryanlohxz.com/api/users-service/signup', { + name: 'Test 3', + email: 'test3@example.com', + password: 'testpassword', + }); + expect(response.status).not.toBeNull(); +}); diff --git a/tests/example.test.js b/tests/example.test.js new file mode 100644 index 00000000..9156687a --- /dev/null +++ b/tests/example.test.js @@ -0,0 +1,9 @@ +const axios = require('axios'); + +test('Test API endpoint 1', async () => { + const response = await axios.get('http://peerpreptest.bryanlohxz.com/api/questions-service/questions/', { + headers: { Authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImMxZGQyMDJkLTc4ZWQtNDI0OS04MzQ4LWY4MzAxMGE3MjUyMCIsImlzc3VlZEF0IjoiMjAyMy0xMS0wMVQwOTo1Nzo0NC4xMzJaIiwiaWF0IjoxNjk4ODMyNjY0fQ.sxL_JcZwlW6D_-ir4Um8forgnEUTDPoECcZQTuBV7Hc"} + }); + expect(response.status).toBe(200); + //expect(response.data).toEqual({ /* expected response data */ }); +}); diff --git a/tests/package.json b/tests/package.json index 24790211..dda06367 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "axios": "^1.6.0", "jest": "^29.7.0" } } diff --git a/tests/yarn.lock b/tests/yarn.lock index 4772fcb9..bc2fd019 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -685,6 +685,20 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +axios@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" + integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + babel-jest@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" @@ -882,6 +896,13 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -931,6 +952,11 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" @@ -1041,6 +1067,20 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +follow-redirects@^1.15.0: + version "1.15.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" + integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1690,6 +1730,18 @@ micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -1843,6 +1895,11 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + pure-rand@^6.0.0: version "6.0.4" resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7" From 9513e4f949c559becd976ae0dd0110218d1577f0 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Wed, 1 Nov 2023 22:30:27 +0800 Subject: [PATCH 03/26] Save token --- tests/SignUp.test.js | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/tests/SignUp.test.js b/tests/SignUp.test.js index e2f873f8..e0be0e12 100644 --- a/tests/SignUp.test.js +++ b/tests/SignUp.test.js @@ -1,10 +1,37 @@ const axios = require('axios'); -test('Test something that requires authentication', async () => { - const response = await axios.post('http://peerpreptest.bryanlohxz.com/api/users-service/signup', { - name: 'Test 3', - email: 'test3@example.com', - password: 'testpassword', +const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" +let token + +test('Sign up for new user profile', async () => { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: 'Test User', + email: 'testuser@example.com', + password: 'testuser', + }); + + expect(response.status).toBe(200) + expect(response.data.token).not.toBeNull(); + token = response.data.token + console.log(token) +}); + +test('Login into PeerPrepTest', async () => { + const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: 'testuser@example.com', + password: 'testuser', }); - expect(response.status).not.toBeNull(); + expect(response.status).toBe(200); }); + +// test('Delete user profile with a valid token', async () => { + +// // Make a request to delete the user profile with the valid token +// const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { +// headers: { +// Authorization: token, +// }, +// }); +// console.log(token) +// expect(response.status).toBe(200); +// }); From a35f728027935effe70af3a277f2543330f2b519 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Thu, 2 Nov 2023 17:33:57 +0800 Subject: [PATCH 04/26] Fix token for delete user test --- tests/SignUp.test.js | 28 ++++++++++++++-------------- tests/example.test.js | 9 --------- 2 files changed, 14 insertions(+), 23 deletions(-) delete mode 100644 tests/example.test.js diff --git a/tests/SignUp.test.js b/tests/SignUp.test.js index e0be0e12..9d882bc4 100644 --- a/tests/SignUp.test.js +++ b/tests/SignUp.test.js @@ -9,11 +9,8 @@ test('Sign up for new user profile', async () => { email: 'testuser@example.com', password: 'testuser', }); - + expect(response.status).toBe(200) - expect(response.data.token).not.toBeNull(); - token = response.data.token - console.log(token) }); test('Login into PeerPrepTest', async () => { @@ -21,17 +18,20 @@ test('Login into PeerPrepTest', async () => { email: 'testuser@example.com', password: 'testuser', }); + expect(response.data.token).not.toBeNull(); expect(response.status).toBe(200); + expect(response.data.token).not.toBeNull(); + token = response.data.token }); -// test('Delete user profile with a valid token', async () => { +test('Delete user profile with a valid token', async () => { -// // Make a request to delete the user profile with the valid token -// const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { -// headers: { -// Authorization: token, -// }, -// }); -// console.log(token) -// expect(response.status).toBe(200); -// }); + // Make a request to delete the user profile with the valid token + const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + headers: { + Authorization: token, + }, + }); + console.log(token) + expect(response.status).toBe(200); +}); diff --git a/tests/example.test.js b/tests/example.test.js deleted file mode 100644 index 9156687a..00000000 --- a/tests/example.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const axios = require('axios'); - -test('Test API endpoint 1', async () => { - const response = await axios.get('http://peerpreptest.bryanlohxz.com/api/questions-service/questions/', { - headers: { Authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImMxZGQyMDJkLTc4ZWQtNDI0OS04MzQ4LWY4MzAxMGE3MjUyMCIsImlzc3VlZEF0IjoiMjAyMy0xMS0wMVQwOTo1Nzo0NC4xMzJaIiwiaWF0IjoxNjk4ODMyNjY0fQ.sxL_JcZwlW6D_-ir4Um8forgnEUTDPoECcZQTuBV7Hc"} - }); - expect(response.status).toBe(200); - //expect(response.data).toEqual({ /* expected response data */ }); -}); From 066f375d864b722017afb78089a630b1ad762789 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Thu, 2 Nov 2023 18:06:00 +0800 Subject: [PATCH 05/26] Add tests for login and delete --- tests/SignUp.test.js | 59 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/tests/SignUp.test.js b/tests/SignUp.test.js index 9d882bc4..bac83c98 100644 --- a/tests/SignUp.test.js +++ b/tests/SignUp.test.js @@ -1,6 +1,11 @@ const axios = require('axios'); const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" +const INCORRECT_PASSWORD_MSG = "The password entered is incorrect."; +const INVALID_JWT_ERROR_MSG = "JWT is either missing, invalid or has expired."; +const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; +const SERVER_ERROR_MSG = "Sorry, something went wrong with the server."; +const USER_NOT_FOUND_MSG = "Sorry, the user cannot be found."; let token test('Sign up for new user profile', async () => { @@ -13,25 +18,71 @@ test('Sign up for new user profile', async () => { expect(response.status).toBe(200) }); +test('Login with Invalid Request Body', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: 'sample@email.com', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } +}); + +test('Login with User Not Found', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: 'nonexistent@example.com', + password: 'password', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(USER_NOT_FOUND_MSG); + } +}); + +test('Login with Incorrect Password', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: 'testuser@example.com', + password: 'incorrectpassword', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INCORRECT_PASSWORD_MSG); + } +}); + + test('Login into PeerPrepTest', async () => { const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { email: 'testuser@example.com', password: 'testuser', }); - expect(response.data.token).not.toBeNull(); expect(response.status).toBe(200); expect(response.data.token).not.toBeNull(); token = response.data.token }); -test('Delete user profile with a valid token', async () => { +test('Delete user profile with unauthorized token', async () => { + try { + const unauthorizedToken = 'invalid-token'; + const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + headers: { + Authorization: unauthorizedToken, + }, + }); + } catch (error) { + expect(error.response.status).toBe(401); + expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) + } +}); - // Make a request to delete the user profile with the valid token +test('Delete user profile with a valid token', async () => { const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { headers: { Authorization: token, }, }); - console.log(token) expect(response.status).toBe(200); }); From 51ef471d24054af1c1cf85968660eff76a6fedf5 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 10:41:18 +0800 Subject: [PATCH 06/26] Add tests for signup errors --- tests/SignUp.test.js | 54 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/tests/SignUp.test.js b/tests/SignUp.test.js index bac83c98..8e146afe 100644 --- a/tests/SignUp.test.js +++ b/tests/SignUp.test.js @@ -4,11 +4,12 @@ const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service const INCORRECT_PASSWORD_MSG = "The password entered is incorrect."; const INVALID_JWT_ERROR_MSG = "JWT is either missing, invalid or has expired."; const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; -const SERVER_ERROR_MSG = "Sorry, something went wrong with the server."; const USER_NOT_FOUND_MSG = "Sorry, the user cannot be found."; +const USER_WITH_SAME_EMAIL_FOUND_MSG = "Another user with this email already exists." + let token -test('Sign up for new user profile', async () => { +test('Sign up for new user profile successfully', async () => { const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { name: 'Test User', email: 'testuser@example.com', @@ -18,6 +19,55 @@ test('Sign up for new user profile', async () => { expect(response.status).toBe(200) }); +test('Sign up for new user profile with existing email', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: 'Test User With Same Email', + email: 'testuser@example.com', + password: 'testuser123', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(USER_WITH_SAME_EMAIL_FOUND_MSG); + } +}); + +test('Sign up for new user profile without name in request body', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + email: 'test@example.com', + password: 'test', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } +}); + +test('Sign up for new user profile without email in request body', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: 'Test User', + password: 'test', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } +}); + +test('Sign up for new user profile without password in request body', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: 'Test User', + email: 'test@example.com', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } +}); + test('Login with Invalid Request Body', async () => { try { const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { From 402fe9a5394f281b3294ee11e9f718b108c5464f Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 11:44:31 +0800 Subject: [PATCH 07/26] Add test to get user profile --- tests/SignUp.test.js | 50 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/tests/SignUp.test.js b/tests/SignUp.test.js index 8e146afe..a47fc813 100644 --- a/tests/SignUp.test.js +++ b/tests/SignUp.test.js @@ -7,15 +7,18 @@ const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; const USER_NOT_FOUND_MSG = "Sorry, the user cannot be found."; const USER_WITH_SAME_EMAIL_FOUND_MSG = "Another user with this email already exists." +const TEST_NAME = "John Doe"; +const TEST_EMAIL = "johndoe@example.com"; +const TEST_PWD = "john123" + let token test('Sign up for new user profile successfully', async () => { const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { - name: 'Test User', - email: 'testuser@example.com', - password: 'testuser', + name: TEST_NAME, + email: TEST_EMAIL, + password: TEST_PWD, }); - expect(response.status).toBe(200) }); @@ -23,7 +26,7 @@ test('Sign up for new user profile with existing email', async () => { try { const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { name: 'Test User With Same Email', - email: 'testuser@example.com', + email: TEST_EMAIL, password: 'testuser123', }); } catch (error) { @@ -71,7 +74,7 @@ test('Sign up for new user profile without password in request body', async () = test('Login with Invalid Request Body', async () => { try { const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { - email: 'sample@email.com', + email: TEST_EMAIL, }); } catch (error) { expect(error.response.status).toBe(400); @@ -79,7 +82,7 @@ test('Login with Invalid Request Body', async () => { } }); -test('Login with User Not Found', async () => { +test('Login with non-existant user email', async () => { try { const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { email: 'nonexistent@example.com', @@ -94,7 +97,7 @@ test('Login with User Not Found', async () => { test('Login with Incorrect Password', async () => { try { const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { - email: 'testuser@example.com', + email: TEST_EMAIL, password: 'incorrectpassword', }); } catch (error) { @@ -103,17 +106,42 @@ test('Login with Incorrect Password', async () => { } }); - test('Login into PeerPrepTest', async () => { const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { - email: 'testuser@example.com', - password: 'testuser', + email: TEST_EMAIL, + password: TEST_PWD, }); expect(response.status).toBe(200); expect(response.data.token).not.toBeNull(); token = response.data.token }); +test('Get own profile with valid token', async () => { + const response = await axios.get( + `${USERS_SERVICE_HOST}/profile`, + { headers: { Authorization: token } + }); + expect(response.status).toBe(200); + expect(response.data).not.toBeNull() + + const user = response.data; + expect(user.name).toBe(TEST_NAME) + expect(user.email).toBe(TEST_EMAIL) + expect(user.isMaintainer).toBeFalsy() +}); + +test('Get own profile with invalid token', async () => { + try { + const response = await axios.get( + `${USERS_SERVICE_HOST}/profile`, + { headers: { Authorization: "invalid-token" } + }); + } catch (error) { + expect(error.response.status).toBe(401); + expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) + } +}); + test('Delete user profile with unauthorized token', async () => { try { const unauthorizedToken = 'invalid-token'; From 2f15f0d8f34a6592223e7780a7b504529888d497 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 12:14:18 +0800 Subject: [PATCH 08/26] Add update profile tests --- tests/SignUp.test.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/SignUp.test.js b/tests/SignUp.test.js index a47fc813..e84f2887 100644 --- a/tests/SignUp.test.js +++ b/tests/SignUp.test.js @@ -142,6 +142,49 @@ test('Get own profile with invalid token', async () => { } }); +test('Update profile successfully', async () => { + const response = await axios.put( + `${USERS_SERVICE_HOST}/profile`, + { + name: "John", + profileImageUrl: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png" + }, + { headers: { Authorization: token } } + ); + expect(response.status).toBe(200); +}); + +test('Update profile with invalid token', async () => { + try { + const response = await axios.put( + `${USERS_SERVICE_HOST}/profile`, + { + name: "John", + profileImageUrl: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png" + }, + { headers: { Authorization: "invalid-token" } } + ); + } catch (error) { + expect(error.response.status).toBe(401); + expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) + } +}); + +test('Update profile with invalid request body', async () => { + try { + const response = await axios.put( + `${USERS_SERVICE_HOST}/profile`, + { + profileImageUrl: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png" + }, + { headers: { Authorization: token } } + ); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE) + } +}); + test('Delete user profile with unauthorized token', async () => { try { const unauthorizedToken = 'invalid-token'; From 571b52d138cf767dc41e32484cbb6116e7d55f25 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 12:25:22 +0800 Subject: [PATCH 09/26] Change user profile test file name --- tests/{SignUp.test.js => userProfile.test.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{SignUp.test.js => userProfile.test.js} (100%) diff --git a/tests/SignUp.test.js b/tests/userProfile.test.js similarity index 100% rename from tests/SignUp.test.js rename to tests/userProfile.test.js From 2331958a287d91716d6da5d4a180cbe2a7a044fc Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 15:26:03 +0800 Subject: [PATCH 10/26] Add questions test --- tests/questions.test.js | 57 +++++++++++++++++++++++++++++++++++++++ tests/userProfile.test.js | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 tests/questions.test.js diff --git a/tests/questions.test.js b/tests/questions.test.js new file mode 100644 index 00000000..5e2946b4 --- /dev/null +++ b/tests/questions.test.js @@ -0,0 +1,57 @@ +const axios = require('axios'); + +const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service"; +const QUESTIOS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/questions-service" + +const TEST_NAME = "John Doe"; +const TEST_EMAIL = "johndoe@example.com"; +const TEST_PWD = "john123"; + +let token; + +test('Sign up for new user profile successfully', async () => { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: TEST_NAME, + email: TEST_EMAIL, + password: TEST_PWD, + }); + expect(response.status).toBe(200) +}); + +test('Login into PeerPrepTest', async () => { + const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: TEST_EMAIL, + password: TEST_PWD, + }); + expect(response.status).toBe(200); + expect(response.data.token).not.toBeNull(); + token = response.data.token +}); + +test('Login into PeerPrepTest', async () => { + const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: TEST_EMAIL, + password: TEST_PWD, + }); + expect(response.status).toBe(200); + expect(response.data.token).not.toBeNull(); + token = response.data.token +}); + +test('Get all questions', async () => { + const response = await axios.get( + `${QUESTIOS_SERVICE_HOST}/questions`, + { headers: { Authorization: token }} + ); + expect(response.status).toBe(200) + console.log(response.data) +}); + +test('Delete user profile with a valid token', async () => { + const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + headers: { + Authorization: token, + }, + }); + expect(response.status).toBe(200); +}); diff --git a/tests/userProfile.test.js b/tests/userProfile.test.js index e84f2887..2dfd64fc 100644 --- a/tests/userProfile.test.js +++ b/tests/userProfile.test.js @@ -9,7 +9,7 @@ const USER_WITH_SAME_EMAIL_FOUND_MSG = "Another user with this email already exi const TEST_NAME = "John Doe"; const TEST_EMAIL = "johndoe@example.com"; -const TEST_PWD = "john123" +const TEST_PWD = "john123"; let token From b44f95ad219189b046bf8eefe69d1beeff183a0c Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 20:37:30 +0800 Subject: [PATCH 11/26] Organise user-service tests --- tests/.gitignore | 2 +- tests/delete.test.js | 56 ++++++++++ tests/login.test.js | 83 +++++++++++++++ tests/questions.test.js | 42 ++++---- tests/signUp.test.js | 83 +++++++++++++++ tests/update.test.js | 132 ++++++++++++++++++++++++ tests/userProfile.test.js | 209 -------------------------------------- 7 files changed, 380 insertions(+), 227 deletions(-) create mode 100644 tests/delete.test.js create mode 100644 tests/login.test.js create mode 100644 tests/signUp.test.js create mode 100644 tests/update.test.js delete mode 100644 tests/userProfile.test.js diff --git a/tests/.gitignore b/tests/.gitignore index 30bc1627..07e6e472 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1 +1 @@ -/node_modules \ No newline at end of file +/node_modules diff --git a/tests/delete.test.js b/tests/delete.test.js new file mode 100644 index 00000000..ca726dd0 --- /dev/null +++ b/tests/delete.test.js @@ -0,0 +1,56 @@ +const axios = require('axios'); + +const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" + +const INCORRECT_PASSWORD_MSG = "The password entered is incorrect."; +const INVALID_JWT_ERROR_MSG = "JWT is either missing, invalid or has expired."; +const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; +const USER_NOT_FOUND_MSG = "Sorry, the user cannot be found."; +const USER_WITH_SAME_EMAIL_FOUND_MSG = "Another user with this email already exists." + +const TEST_NAME = "Sophie Baker"; +const TEST_EMAIL = "sophiebaker@example.com"; +const TEST_PWD = "sophieBaker"; + +let token; + +beforeAll(async () => { + try { + await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: TEST_NAME, + email: TEST_EMAIL, + password: TEST_PWD, + }); + } catch (error) { + } + + const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: TEST_EMAIL, + password: TEST_PWD, + }); + + token = response.data.token +}); + +test('Delete user profile with unauthorized token', async () => { + try { + const unauthorizedToken = 'invalid-token'; + const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + headers: { + Authorization: unauthorizedToken, + }, + }); + } catch (error) { + expect(error.response.status).toBe(401); + expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) + } +}); + +test('Delete user profile with a valid token', async () => { + const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + headers: { + Authorization: token, + }, + }); + expect(response.status).toBe(200); +}); \ No newline at end of file diff --git a/tests/login.test.js b/tests/login.test.js new file mode 100644 index 00000000..acd0e20d --- /dev/null +++ b/tests/login.test.js @@ -0,0 +1,83 @@ +const axios = require('axios'); + +const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" + +const INCORRECT_PASSWORD_MSG = "The password entered is incorrect."; +const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; +const USER_NOT_FOUND_MSG = "Sorry, the user cannot be found."; + +const TEST_NAME = "Adam Smith"; +const TEST_EMAIL = "adamsmith@example.com"; +const TEST_PWD = "adamSmith"; + +beforeAll(async () => { + try { + await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: TEST_NAME, + email: TEST_EMAIL, + password: TEST_PWD, + }); + } catch (error) { + } +}); + +describe('Login with invalid request body', () => { + test('Login without password in request body', async () => { + try { + await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: TEST_EMAIL, + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); + + test('Login without password in request body', async () => { + try { + await axios.post(`${USERS_SERVICE_HOST}/login`, { + password: TEST_PWD, + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); +}); + +describe('Login with invalid credentials', () => { + test('Login with non-existant user email', async () => { + try { + await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: 'nonexistent@example.com', + password: TEST_PWD, + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(USER_NOT_FOUND_MSG); + } + }); + + test('Login with incorrect password', async () => { + try { + await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: TEST_EMAIL, + password: 'incorrectpassword', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INCORRECT_PASSWORD_MSG); + } + }); +}); + +describe('Login successfully', () => { + test('Login into PeerPrepTest', async () => { + const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: TEST_EMAIL, + password: TEST_PWD, + }); + expect(response.status).toBe(200); + expect(response.data.token).not.toBeNull(); + }); +}); \ No newline at end of file diff --git a/tests/questions.test.js b/tests/questions.test.js index 5e2946b4..f7cbc3ae 100644 --- a/tests/questions.test.js +++ b/tests/questions.test.js @@ -3,19 +3,36 @@ const axios = require('axios'); const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service"; const QUESTIOS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/questions-service" -const TEST_NAME = "John Doe"; -const TEST_EMAIL = "johndoe@example.com"; -const TEST_PWD = "john123"; +const TEST_NAME = "Mary Allan"; +const TEST_EMAIL = "maryallan@example.com"; +const TEST_PWD = "mary123"; let token; -test('Sign up for new user profile successfully', async () => { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, +beforeEach(async () => { + try { + await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: TEST_NAME, + email: TEST_EMAIL, + password: TEST_PWD, + }); + } catch (error) { + } + + const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { email: TEST_EMAIL, password: TEST_PWD, }); - expect(response.status).toBe(200) + + token = response.data.token +}); + +afterEach(async () => { + await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + headers: { + Authorization: token, + }, + }); }); test('Login into PeerPrepTest', async () => { @@ -44,14 +61,5 @@ test('Get all questions', async () => { { headers: { Authorization: token }} ); expect(response.status).toBe(200) - console.log(response.data) -}); - -test('Delete user profile with a valid token', async () => { - const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { - headers: { - Authorization: token, - }, - }); - expect(response.status).toBe(200); + //console.log(response.data) }); diff --git a/tests/signUp.test.js b/tests/signUp.test.js new file mode 100644 index 00000000..3c40aa94 --- /dev/null +++ b/tests/signUp.test.js @@ -0,0 +1,83 @@ +const axios = require('axios'); + +const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" + +const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; +const USER_WITH_SAME_EMAIL_FOUND_MSG = "Another user with this email already exists." + +const TEST_NAME = "John Doe"; +const TEST_EMAIL = "johndoe@example.com"; +const TEST_PWD = "john123"; + +describe('Sign-up Successfully', () => { + test('Sign up for new user profile successfully', async () => { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: TEST_NAME, + email: TEST_EMAIL, + password: TEST_PWD, + }); + expect(response.status).toBe(200) + }); +}); + +describe('Sign-up with existing email', () => { + test('Sign up for new user profile with existing email', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: 'Test User With Same Email', + email: TEST_EMAIL, + password: 'testuser123', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(USER_WITH_SAME_EMAIL_FOUND_MSG); + } + }); +}); + +describe('Sign-up with invalid request body', () => { + test('Sign up without name in request body', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + email: 'test@example.com', + password: 'test', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); + + test('Sign up without email in request body', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: TEST_NAME, + password: 'test', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); + + test('Sign up without password in request body', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: TEST_NAME, + email: 'test@example.com', + }); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); + + test('Sign up with empty request body', async () => { + try { + const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, {}); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); +}); diff --git a/tests/update.test.js b/tests/update.test.js new file mode 100644 index 00000000..dc48321f --- /dev/null +++ b/tests/update.test.js @@ -0,0 +1,132 @@ +const axios = require('axios'); + +const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" +const INCORRECT_PASSWORD_MSG = "The password entered is incorrect."; +const INVALID_JWT_ERROR_MSG = "JWT is either missing, invalid or has expired."; +const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; +const USER_NOT_FOUND_MSG = "Sorry, the user cannot be found."; +const USER_WITH_SAME_EMAIL_FOUND_MSG = "Another user with this email already exists." + +const TEST_NAME = "Frank Bell"; +const TEST_EMAIL = "frankbell@example.com"; +const TEST_PWD = "frank#!"; +const UPDATED_NAME = "Frankie"; +const IMAGE_URL = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png"; + +let token; + +beforeEach(async () => { + try { + await axios.post(`${USERS_SERVICE_HOST}/signup`, { + name: TEST_NAME, + email: TEST_EMAIL, + password: TEST_PWD, + }); + } catch (error) { + } + + const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + email: TEST_EMAIL, + password: TEST_PWD, + }); + + token = response.data.token +}); + +afterEach(async () => { + await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + headers: { + Authorization: token, + }, + }); +}); + +describe('View user profile', () => { + test('Get profile with valid token', async () => { + const response = await axios.get( + `${USERS_SERVICE_HOST}/profile`, + { headers: { Authorization: token } + }); + expect(response.status).toBe(200); + expect(response.data).not.toBeNull() + + const user = response.data; + expect(user.name).toBe(TEST_NAME) + expect(user.email).toBe(TEST_EMAIL) + expect(user.isMaintainer).toBeFalsy() + }); + + test('Get profile with invalid token', async () => { + try { + const response = await axios.get( + `${USERS_SERVICE_HOST}/profile`, + { headers: { Authorization: "invalid-token" } + }); + } catch (error) { + expect(error.response.status).toBe(401); + expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) + } + }); +}); + +describe('Update user profile successfully', () => { + test('Update profile successfully', async () => { + const response = await axios.put( + `${USERS_SERVICE_HOST}/profile`, + { + name: UPDATED_NAME, + profileImageUrl: IMAGE_URL + }, + { headers: { Authorization: token } } + ); + expect(response.status).toBe(200); + }); +}); + +describe('Update user profile with invalid token', () => { + test('Update profile with invalid token', async () => { + try { + const response = await axios.put( + `${USERS_SERVICE_HOST}/profile`, + { + name: UPDATED_NAME, + profileImageUrl: IMAGE_URL + }, + { headers: { Authorization: "invalid-token" } } + ); + } catch (error) { + expect(error.response.status).toBe(401); + expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) + } + }); +}); + +describe('Update user profile invalid request body', () => { + test('Update profile without name', async () => { + try { + const response = await axios.put( + `${USERS_SERVICE_HOST}/profile`, + { + profileImageUrl: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png" + }, + { headers: { Authorization: token } } + ); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE) + } + }); + + test('Update profile with empty request body', async () => { + try { + const response = await axios.put( + `${USERS_SERVICE_HOST}/profile`, + {}, + { headers: { Authorization: token } } + ); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE) + } + }); +}); \ No newline at end of file diff --git a/tests/userProfile.test.js b/tests/userProfile.test.js deleted file mode 100644 index 2dfd64fc..00000000 --- a/tests/userProfile.test.js +++ /dev/null @@ -1,209 +0,0 @@ -const axios = require('axios'); - -const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" -const INCORRECT_PASSWORD_MSG = "The password entered is incorrect."; -const INVALID_JWT_ERROR_MSG = "JWT is either missing, invalid or has expired."; -const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; -const USER_NOT_FOUND_MSG = "Sorry, the user cannot be found."; -const USER_WITH_SAME_EMAIL_FOUND_MSG = "Another user with this email already exists." - -const TEST_NAME = "John Doe"; -const TEST_EMAIL = "johndoe@example.com"; -const TEST_PWD = "john123"; - -let token - -test('Sign up for new user profile successfully', async () => { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, - email: TEST_EMAIL, - password: TEST_PWD, - }); - expect(response.status).toBe(200) -}); - -test('Sign up for new user profile with existing email', async () => { - try { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { - name: 'Test User With Same Email', - email: TEST_EMAIL, - password: 'testuser123', - }); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(USER_WITH_SAME_EMAIL_FOUND_MSG); - } -}); - -test('Sign up for new user profile without name in request body', async () => { - try { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { - email: 'test@example.com', - password: 'test', - }); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); - } -}); - -test('Sign up for new user profile without email in request body', async () => { - try { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { - name: 'Test User', - password: 'test', - }); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); - } -}); - -test('Sign up for new user profile without password in request body', async () => { - try { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { - name: 'Test User', - email: 'test@example.com', - }); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); - } -}); - -test('Login with Invalid Request Body', async () => { - try { - const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - }); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); - } -}); - -test('Login with non-existant user email', async () => { - try { - const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { - email: 'nonexistent@example.com', - password: 'password', - }); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(USER_NOT_FOUND_MSG); - } -}); - -test('Login with Incorrect Password', async () => { - try { - const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: 'incorrectpassword', - }); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INCORRECT_PASSWORD_MSG); - } -}); - -test('Login into PeerPrepTest', async () => { - const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: TEST_PWD, - }); - expect(response.status).toBe(200); - expect(response.data.token).not.toBeNull(); - token = response.data.token -}); - -test('Get own profile with valid token', async () => { - const response = await axios.get( - `${USERS_SERVICE_HOST}/profile`, - { headers: { Authorization: token } - }); - expect(response.status).toBe(200); - expect(response.data).not.toBeNull() - - const user = response.data; - expect(user.name).toBe(TEST_NAME) - expect(user.email).toBe(TEST_EMAIL) - expect(user.isMaintainer).toBeFalsy() -}); - -test('Get own profile with invalid token', async () => { - try { - const response = await axios.get( - `${USERS_SERVICE_HOST}/profile`, - { headers: { Authorization: "invalid-token" } - }); - } catch (error) { - expect(error.response.status).toBe(401); - expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) - } -}); - -test('Update profile successfully', async () => { - const response = await axios.put( - `${USERS_SERVICE_HOST}/profile`, - { - name: "John", - profileImageUrl: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png" - }, - { headers: { Authorization: token } } - ); - expect(response.status).toBe(200); -}); - -test('Update profile with invalid token', async () => { - try { - const response = await axios.put( - `${USERS_SERVICE_HOST}/profile`, - { - name: "John", - profileImageUrl: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png" - }, - { headers: { Authorization: "invalid-token" } } - ); - } catch (error) { - expect(error.response.status).toBe(401); - expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) - } -}); - -test('Update profile with invalid request body', async () => { - try { - const response = await axios.put( - `${USERS_SERVICE_HOST}/profile`, - { - profileImageUrl: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png" - }, - { headers: { Authorization: token } } - ); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE) - } -}); - -test('Delete user profile with unauthorized token', async () => { - try { - const unauthorizedToken = 'invalid-token'; - const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { - headers: { - Authorization: unauthorizedToken, - }, - }); - } catch (error) { - expect(error.response.status).toBe(401); - expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) - } -}); - -test('Delete user profile with a valid token', async () => { - const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { - headers: { - Authorization: token, - }, - }); - expect(response.status).toBe(200); -}); From 649c2ec71b98307bb4200a0fe4180e1b6a43605f Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 22:35:47 +0800 Subject: [PATCH 12/26] Organise tests by service and set up environment variables --- tests/package.json | 5 +++ tests/questions.test.js | 28 +++------------ tests/setEnvVars.js | 17 +++++++++ tests/{ => users-service}/delete.test.js | 18 ++++------ tests/users-service/errors.js | 8 +++++ tests/{ => users-service}/login.test.js | 22 ++++++------ tests/{ => users-service}/signUp.test.js | 21 +++++------ tests/{ => users-service}/update.test.js | 46 ++++++++++-------------- 8 files changed, 81 insertions(+), 84 deletions(-) create mode 100644 tests/setEnvVars.js rename tests/{ => users-service}/delete.test.js (54%) create mode 100644 tests/users-service/errors.js rename tests/{ => users-service}/login.test.js (73%) rename tests/{ => users-service}/signUp.test.js (72%) rename tests/{ => users-service}/update.test.js (67%) diff --git a/tests/package.json b/tests/package.json index dda06367..20c9d516 100644 --- a/tests/package.json +++ b/tests/package.json @@ -2,5 +2,10 @@ "dependencies": { "axios": "^1.6.0", "jest": "^29.7.0" + }, + "jest": { + "setupFiles": [ + "/setEnvVars.js" + ] } } diff --git a/tests/questions.test.js b/tests/questions.test.js index f7cbc3ae..65c5a8c7 100644 --- a/tests/questions.test.js +++ b/tests/questions.test.js @@ -11,7 +11,7 @@ let token; beforeEach(async () => { try { - await axios.post(`${USERS_SERVICE_HOST}/signup`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, email: TEST_EMAIL, password: TEST_PWD, @@ -19,7 +19,7 @@ beforeEach(async () => { } catch (error) { } - const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { email: TEST_EMAIL, password: TEST_PWD, }); @@ -28,36 +28,16 @@ beforeEach(async () => { }); afterEach(async () => { - await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { headers: { Authorization: token, }, }); }); -test('Login into PeerPrepTest', async () => { - const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: TEST_PWD, - }); - expect(response.status).toBe(200); - expect(response.data.token).not.toBeNull(); - token = response.data.token -}); - -test('Login into PeerPrepTest', async () => { - const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: TEST_PWD, - }); - expect(response.status).toBe(200); - expect(response.data.token).not.toBeNull(); - token = response.data.token -}); - test('Get all questions', async () => { const response = await axios.get( - `${QUESTIOS_SERVICE_HOST}/questions`, + `${process.env.REACT_APP_QUESTIONS_SERVICE_HOST}/questions`, { headers: { Authorization: token }} ); expect(response.status).toBe(200) diff --git a/tests/setEnvVars.js b/tests/setEnvVars.js new file mode 100644 index 00000000..ef26000d --- /dev/null +++ b/tests/setEnvVars.js @@ -0,0 +1,17 @@ +// Development +// process.env.REACT_APP_QUESTIONS_SERVICE_HOST="http://localhost:3001"; +// process.env.REACT_APP_USERS_SERVICE_HOST="http://localhost:3002"; +// process.env.REACT_APP_MATCHMAKING_SERVICE_HOST="http://localhost:3003"; +// process.env.REACT_APP_COLLABORATION_SERVICE_HOST="http://localhost:3004"; + +// Testing +process.env.REACT_APP_QUESTIONS_SERVICE_HOST="http://peerpreptest.bryanlohxz.com/api/questions-service"; +process.env.REACT_APP_USERS_SERVICE_HOST="http://peerpreptest.bryanlohxz.com/api/users-service"; +process.env.REACT_APP_MATCHMAKING_SERVICE_HOST="http://peerpreptest.bryanlohxz.com/api/matchmaking-service"; +process.env.REACT_APP_COLLABORATION_SERVICE_HOST="http://peerpreptest.bryanlohxz.com/api/collaboration-service"; + +// Production +// process.env.REACT_APP_QUESTIONS_SERVICE_HOST="http://peerprep.bryanlohxz.com/api/questions-service"; +// process.env.REACT_APP_USERS_SERVICE_HOST="http://peerprep.bryanlohxz.com/api/users-service"; +// process.env.REACT_APP_MATCHMAKING_SERVICE_HOST="http://peerprep.bryanlohxz.com/api/matchmaking-service"; +// process.env.REACT_APP_COLLABORATION_SERVICE_HOST="http://peerprep.bryanlohxz.com/api/collaboration-service"; diff --git a/tests/delete.test.js b/tests/users-service/delete.test.js similarity index 54% rename from tests/delete.test.js rename to tests/users-service/delete.test.js index ca726dd0..5c7c9a63 100644 --- a/tests/delete.test.js +++ b/tests/users-service/delete.test.js @@ -1,12 +1,8 @@ const axios = require('axios'); -const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" - -const INCORRECT_PASSWORD_MSG = "The password entered is incorrect."; -const INVALID_JWT_ERROR_MSG = "JWT is either missing, invalid or has expired."; -const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; -const USER_NOT_FOUND_MSG = "Sorry, the user cannot be found."; -const USER_WITH_SAME_EMAIL_FOUND_MSG = "Another user with this email already exists." +const { + INVALID_JWT_ERROR_MSG +} = require("./errors.js"); const TEST_NAME = "Sophie Baker"; const TEST_EMAIL = "sophiebaker@example.com"; @@ -16,7 +12,7 @@ let token; beforeAll(async () => { try { - await axios.post(`${USERS_SERVICE_HOST}/signup`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, email: TEST_EMAIL, password: TEST_PWD, @@ -24,7 +20,7 @@ beforeAll(async () => { } catch (error) { } - const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { email: TEST_EMAIL, password: TEST_PWD, }); @@ -35,7 +31,7 @@ beforeAll(async () => { test('Delete user profile with unauthorized token', async () => { try { const unauthorizedToken = 'invalid-token'; - const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + const response = await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { headers: { Authorization: unauthorizedToken, }, @@ -47,7 +43,7 @@ test('Delete user profile with unauthorized token', async () => { }); test('Delete user profile with a valid token', async () => { - const response = await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + const response = await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { headers: { Authorization: token, }, diff --git a/tests/users-service/errors.js b/tests/users-service/errors.js new file mode 100644 index 00000000..7b84ccaf --- /dev/null +++ b/tests/users-service/errors.js @@ -0,0 +1,8 @@ +module.exports = { + INCORRECT_PASSWORD_MSG: "The password entered is incorrect.", + INVALID_JWT_ERROR_MSG: "JWT is either missing, invalid or has expired.", + INVALID_REQUEST_BODY_ERROR_MESSAGE: "Please check your request body.", + SERVER_ERROR_MSG: "Sorry, something went wrong with the server.", + USER_NOT_FOUND_MSG: "Sorry, the user cannot be found.", + USER_WITH_SAME_EMAIL_FOUND_MSG: "Another user with this email already exists.", +}; diff --git a/tests/login.test.js b/tests/users-service/login.test.js similarity index 73% rename from tests/login.test.js rename to tests/users-service/login.test.js index acd0e20d..a01b8296 100644 --- a/tests/login.test.js +++ b/tests/users-service/login.test.js @@ -1,10 +1,10 @@ const axios = require('axios'); -const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" - -const INCORRECT_PASSWORD_MSG = "The password entered is incorrect."; -const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; -const USER_NOT_FOUND_MSG = "Sorry, the user cannot be found."; +const { + INCORRECT_PASSWORD_MSG, + INVALID_REQUEST_BODY_ERROR_MESSAGE, + USER_NOT_FOUND_MSG +} = require("./errors.js"); const TEST_NAME = "Adam Smith"; const TEST_EMAIL = "adamsmith@example.com"; @@ -12,7 +12,7 @@ const TEST_PWD = "adamSmith"; beforeAll(async () => { try { - await axios.post(`${USERS_SERVICE_HOST}/signup`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, email: TEST_EMAIL, password: TEST_PWD, @@ -24,7 +24,7 @@ beforeAll(async () => { describe('Login with invalid request body', () => { test('Login without password in request body', async () => { try { - await axios.post(`${USERS_SERVICE_HOST}/login`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { email: TEST_EMAIL, }); } catch (error) { @@ -35,7 +35,7 @@ describe('Login with invalid request body', () => { test('Login without password in request body', async () => { try { - await axios.post(`${USERS_SERVICE_HOST}/login`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { password: TEST_PWD, }); } catch (error) { @@ -48,7 +48,7 @@ describe('Login with invalid request body', () => { describe('Login with invalid credentials', () => { test('Login with non-existant user email', async () => { try { - await axios.post(`${USERS_SERVICE_HOST}/login`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { email: 'nonexistent@example.com', password: TEST_PWD, }); @@ -60,7 +60,7 @@ describe('Login with invalid credentials', () => { test('Login with incorrect password', async () => { try { - await axios.post(`${USERS_SERVICE_HOST}/login`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { email: TEST_EMAIL, password: 'incorrectpassword', }); @@ -73,7 +73,7 @@ describe('Login with invalid credentials', () => { describe('Login successfully', () => { test('Login into PeerPrepTest', async () => { - const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { email: TEST_EMAIL, password: TEST_PWD, }); diff --git a/tests/signUp.test.js b/tests/users-service/signUp.test.js similarity index 72% rename from tests/signUp.test.js rename to tests/users-service/signUp.test.js index 3c40aa94..f7d22ccb 100644 --- a/tests/signUp.test.js +++ b/tests/users-service/signUp.test.js @@ -1,9 +1,9 @@ const axios = require('axios'); -const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" - -const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; -const USER_WITH_SAME_EMAIL_FOUND_MSG = "Another user with this email already exists." +const { + INVALID_REQUEST_BODY_ERROR_MESSAGE, + USER_WITH_SAME_EMAIL_FOUND_MSG +} = require("./errors.js"); const TEST_NAME = "John Doe"; const TEST_EMAIL = "johndoe@example.com"; @@ -11,7 +11,7 @@ const TEST_PWD = "john123"; describe('Sign-up Successfully', () => { test('Sign up for new user profile successfully', async () => { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, email: TEST_EMAIL, password: TEST_PWD, @@ -23,7 +23,7 @@ describe('Sign-up Successfully', () => { describe('Sign-up with existing email', () => { test('Sign up for new user profile with existing email', async () => { try { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: 'Test User With Same Email', email: TEST_EMAIL, password: 'testuser123', @@ -38,10 +38,11 @@ describe('Sign-up with existing email', () => { describe('Sign-up with invalid request body', () => { test('Sign up without name in request body', async () => { try { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { email: 'test@example.com', password: 'test', }); + throw new Error("Expected an error but the request succeeded."); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); @@ -50,7 +51,7 @@ describe('Sign-up with invalid request body', () => { test('Sign up without email in request body', async () => { try { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, password: 'test', }); @@ -62,7 +63,7 @@ describe('Sign-up with invalid request body', () => { test('Sign up without password in request body', async () => { try { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, email: 'test@example.com', }); @@ -74,7 +75,7 @@ describe('Sign-up with invalid request body', () => { test('Sign up with empty request body', async () => { try { - const response = await axios.post(`${USERS_SERVICE_HOST}/signup`, {}); + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, {}); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); diff --git a/tests/update.test.js b/tests/users-service/update.test.js similarity index 67% rename from tests/update.test.js rename to tests/users-service/update.test.js index dc48321f..f55f6de3 100644 --- a/tests/update.test.js +++ b/tests/users-service/update.test.js @@ -1,11 +1,9 @@ const axios = require('axios'); -const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service" -const INCORRECT_PASSWORD_MSG = "The password entered is incorrect."; -const INVALID_JWT_ERROR_MSG = "JWT is either missing, invalid or has expired."; -const INVALID_REQUEST_BODY_ERROR_MESSAGE = "Please check your request body."; -const USER_NOT_FOUND_MSG = "Sorry, the user cannot be found."; -const USER_WITH_SAME_EMAIL_FOUND_MSG = "Another user with this email already exists." +const { + INVALID_JWT_ERROR_MSG, + INVALID_REQUEST_BODY_ERROR_MESSAGE +} = require("./errors.js"); const TEST_NAME = "Frank Bell"; const TEST_EMAIL = "frankbell@example.com"; @@ -17,7 +15,7 @@ let token; beforeEach(async () => { try { - await axios.post(`${USERS_SERVICE_HOST}/signup`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, email: TEST_EMAIL, password: TEST_PWD, @@ -25,7 +23,7 @@ beforeEach(async () => { } catch (error) { } - const response = await axios.post(`${USERS_SERVICE_HOST}/login`, { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { email: TEST_EMAIL, password: TEST_PWD, }); @@ -34,7 +32,7 @@ beforeEach(async () => { }); afterEach(async () => { - await axios.delete(`${USERS_SERVICE_HOST}/profile`, { + await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { headers: { Authorization: token, }, @@ -44,9 +42,9 @@ afterEach(async () => { describe('View user profile', () => { test('Get profile with valid token', async () => { const response = await axios.get( - `${USERS_SERVICE_HOST}/profile`, - { headers: { Authorization: token } - }); + `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, + { headers: { Authorization: token }} + ); expect(response.status).toBe(200); expect(response.data).not.toBeNull() @@ -59,7 +57,7 @@ describe('View user profile', () => { test('Get profile with invalid token', async () => { try { const response = await axios.get( - `${USERS_SERVICE_HOST}/profile`, + `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { headers: { Authorization: "invalid-token" } }); } catch (error) { @@ -72,11 +70,8 @@ describe('View user profile', () => { describe('Update user profile successfully', () => { test('Update profile successfully', async () => { const response = await axios.put( - `${USERS_SERVICE_HOST}/profile`, - { - name: UPDATED_NAME, - profileImageUrl: IMAGE_URL - }, + `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, + { name: UPDATED_NAME, profileImageUrl: IMAGE_URL }, { headers: { Authorization: token } } ); expect(response.status).toBe(200); @@ -87,11 +82,8 @@ describe('Update user profile with invalid token', () => { test('Update profile with invalid token', async () => { try { const response = await axios.put( - `${USERS_SERVICE_HOST}/profile`, - { - name: UPDATED_NAME, - profileImageUrl: IMAGE_URL - }, + `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, + { name: UPDATED_NAME, profileImageUrl: IMAGE_URL }, { headers: { Authorization: "invalid-token" } } ); } catch (error) { @@ -105,10 +97,8 @@ describe('Update user profile invalid request body', () => { test('Update profile without name', async () => { try { const response = await axios.put( - `${USERS_SERVICE_HOST}/profile`, - { - profileImageUrl: "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png" - }, + `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, + { profileImageUrl: IMAGE_URL }, { headers: { Authorization: token } } ); } catch (error) { @@ -120,7 +110,7 @@ describe('Update user profile invalid request body', () => { test('Update profile with empty request body', async () => { try { const response = await axios.put( - `${USERS_SERVICE_HOST}/profile`, + `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, {}, { headers: { Authorization: token } } ); From 64da60ab741695bb1e298666d48bf0fd3282a8dc Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 22:49:12 +0800 Subject: [PATCH 13/26] Add scripts to run users-service the questions-service --- tests/package.json | 5 +++++ tests/{ => questions-service}/questions.test.js | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) rename tests/{ => questions-service}/questions.test.js (84%) diff --git a/tests/package.json b/tests/package.json index 20c9d516..beb2e7db 100644 --- a/tests/package.json +++ b/tests/package.json @@ -3,6 +3,11 @@ "axios": "^1.6.0", "jest": "^29.7.0" }, + "scripts": { + "test": "yarn test:users-service && yarn test:questions-service", + "test:users-service": "jest users-service --runInBand", + "test:questions-service": "jest questions-service --runInBand" + }, "jest": { "setupFiles": [ "/setEnvVars.js" diff --git a/tests/questions.test.js b/tests/questions-service/questions.test.js similarity index 84% rename from tests/questions.test.js rename to tests/questions-service/questions.test.js index 65c5a8c7..c83415c5 100644 --- a/tests/questions.test.js +++ b/tests/questions-service/questions.test.js @@ -1,8 +1,5 @@ const axios = require('axios'); -const USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service"; -const QUESTIOS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/questions-service" - const TEST_NAME = "Mary Allan"; const TEST_EMAIL = "maryallan@example.com"; const TEST_PWD = "mary123"; From f0ea89832bd9fb995720cbd405948740b864672b Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 23:03:29 +0800 Subject: [PATCH 14/26] Fix tests to throw error upon unexpected api request success --- tests/errors.js | 3 +++ tests/users-service/delete.test.js | 1 + tests/users-service/login.test.js | 5 +++++ tests/users-service/signUp.test.js | 17 +++++++++++------ tests/users-service/update.test.js | 13 +++++++++---- 5 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 tests/errors.js diff --git a/tests/errors.js b/tests/errors.js new file mode 100644 index 00000000..386e71c0 --- /dev/null +++ b/tests/errors.js @@ -0,0 +1,3 @@ +module.exports = { + UNEXPECTED_SUCCESS_MSG: "Expected an error but the request succeeded." +}; diff --git a/tests/users-service/delete.test.js b/tests/users-service/delete.test.js index 5c7c9a63..1c4d8a7d 100644 --- a/tests/users-service/delete.test.js +++ b/tests/users-service/delete.test.js @@ -36,6 +36,7 @@ test('Delete user profile with unauthorized token', async () => { Authorization: unauthorizedToken, }, }); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(401); expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) diff --git a/tests/users-service/login.test.js b/tests/users-service/login.test.js index a01b8296..f78cbbe1 100644 --- a/tests/users-service/login.test.js +++ b/tests/users-service/login.test.js @@ -5,6 +5,7 @@ const { INVALID_REQUEST_BODY_ERROR_MESSAGE, USER_NOT_FOUND_MSG } = require("./errors.js"); +const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); const TEST_NAME = "Adam Smith"; const TEST_EMAIL = "adamsmith@example.com"; @@ -27,6 +28,7 @@ describe('Login with invalid request body', () => { await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { email: TEST_EMAIL, }); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); @@ -38,6 +40,7 @@ describe('Login with invalid request body', () => { await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { password: TEST_PWD, }); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); @@ -52,6 +55,7 @@ describe('Login with invalid credentials', () => { email: 'nonexistent@example.com', password: TEST_PWD, }); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(USER_NOT_FOUND_MSG); @@ -64,6 +68,7 @@ describe('Login with invalid credentials', () => { email: TEST_EMAIL, password: 'incorrectpassword', }); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INCORRECT_PASSWORD_MSG); diff --git a/tests/users-service/signUp.test.js b/tests/users-service/signUp.test.js index f7d22ccb..5a9fcb1e 100644 --- a/tests/users-service/signUp.test.js +++ b/tests/users-service/signUp.test.js @@ -4,6 +4,7 @@ const { INVALID_REQUEST_BODY_ERROR_MESSAGE, USER_WITH_SAME_EMAIL_FOUND_MSG } = require("./errors.js"); +const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); const TEST_NAME = "John Doe"; const TEST_EMAIL = "johndoe@example.com"; @@ -23,11 +24,12 @@ describe('Sign-up Successfully', () => { describe('Sign-up with existing email', () => { test('Sign up for new user profile with existing email', async () => { try { - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: 'Test User With Same Email', email: TEST_EMAIL, password: 'testuser123', }); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(USER_WITH_SAME_EMAIL_FOUND_MSG); @@ -38,11 +40,11 @@ describe('Sign-up with existing email', () => { describe('Sign-up with invalid request body', () => { test('Sign up without name in request body', async () => { try { - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { email: 'test@example.com', password: 'test', }); - throw new Error("Expected an error but the request succeeded."); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); @@ -51,10 +53,11 @@ describe('Sign-up with invalid request body', () => { test('Sign up without email in request body', async () => { try { - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, password: 'test', }); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); @@ -63,10 +66,11 @@ describe('Sign-up with invalid request body', () => { test('Sign up without password in request body', async () => { try { - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, email: 'test@example.com', }); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); @@ -75,7 +79,8 @@ describe('Sign-up with invalid request body', () => { test('Sign up with empty request body', async () => { try { - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, {}); + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, {}); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); diff --git a/tests/users-service/update.test.js b/tests/users-service/update.test.js index f55f6de3..10271d18 100644 --- a/tests/users-service/update.test.js +++ b/tests/users-service/update.test.js @@ -4,6 +4,7 @@ const { INVALID_JWT_ERROR_MSG, INVALID_REQUEST_BODY_ERROR_MESSAGE } = require("./errors.js"); +const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); const TEST_NAME = "Frank Bell"; const TEST_EMAIL = "frankbell@example.com"; @@ -56,10 +57,11 @@ describe('View user profile', () => { test('Get profile with invalid token', async () => { try { - const response = await axios.get( + await axios.get( `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { headers: { Authorization: "invalid-token" } }); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(401); expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) @@ -81,11 +83,12 @@ describe('Update user profile successfully', () => { describe('Update user profile with invalid token', () => { test('Update profile with invalid token', async () => { try { - const response = await axios.put( + await axios.put( `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { name: UPDATED_NAME, profileImageUrl: IMAGE_URL }, { headers: { Authorization: "invalid-token" } } ); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(401); expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) @@ -96,11 +99,12 @@ describe('Update user profile with invalid token', () => { describe('Update user profile invalid request body', () => { test('Update profile without name', async () => { try { - const response = await axios.put( + await axios.put( `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { profileImageUrl: IMAGE_URL }, { headers: { Authorization: token } } ); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE) @@ -109,11 +113,12 @@ describe('Update user profile invalid request body', () => { test('Update profile with empty request body', async () => { try { - const response = await axios.put( + await axios.put( `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, {}, { headers: { Authorization: token } } ); + throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE) From 96469cb9de82334c812d7d0799647e28b90ea6dd Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 23:16:33 +0800 Subject: [PATCH 15/26] Add get question by id test --- tests/questions-service/question.test.js | 42 +++++++++++++++++++++++ tests/questions-service/questions.test.js | 1 - 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/questions-service/question.test.js diff --git a/tests/questions-service/question.test.js b/tests/questions-service/question.test.js new file mode 100644 index 00000000..8d241916 --- /dev/null +++ b/tests/questions-service/question.test.js @@ -0,0 +1,42 @@ +const axios = require('axios'); + +const TEST_NAME = "Blake Boris"; +const TEST_EMAIL = "blake@example.com"; +const TEST_PWD = "blake123"; + +let token; + +beforeEach(async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { + name: TEST_NAME, + email: TEST_EMAIL, + password: TEST_PWD, + }); + } catch (error) { + } + + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { + email: TEST_EMAIL, + password: TEST_PWD, + }); + + token = response.data.token +}); + +afterEach(async () => { + await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { + headers: { + Authorization: token, + }, + }); +}); + +test('Get one questions', async () => { + const response = await axios.get( + `${process.env.REACT_APP_QUESTIONS_SERVICE_HOST}/questions/1`, + { headers: { Authorization: token }} + ); + expect(response.status).toBe(200); + expect(response.data.question_id).toBe(1); +}); \ No newline at end of file diff --git a/tests/questions-service/questions.test.js b/tests/questions-service/questions.test.js index c83415c5..703e8c5c 100644 --- a/tests/questions-service/questions.test.js +++ b/tests/questions-service/questions.test.js @@ -38,5 +38,4 @@ test('Get all questions', async () => { { headers: { Authorization: token }} ); expect(response.status).toBe(200) - //console.log(response.data) }); From b6f7362c30f042cba8a910f96307cd116ae2689d Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 3 Nov 2023 23:53:31 +0800 Subject: [PATCH 16/26] Add test for adding question without permissions --- tests/questions-service/question.test.js | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/questions-service/question.test.js b/tests/questions-service/question.test.js index 8d241916..873cb782 100644 --- a/tests/questions-service/question.test.js +++ b/tests/questions-service/question.test.js @@ -1,5 +1,7 @@ const axios = require('axios'); +const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); + const TEST_NAME = "Blake Boris"; const TEST_EMAIL = "blake@example.com"; const TEST_PWD = "blake123"; @@ -39,4 +41,28 @@ test('Get one questions', async () => { ); expect(response.status).toBe(200); expect(response.data.question_id).toBe(1); +}); + +test('Add new questions without maintainer permission', async () => { + try { + const url = `${process.env.REACT_APP_QUESTIONS_SERVICE_HOST}/questions`; + const header = { + headers: { Authorization: token }, + }; + const params = { + title: "New Question", + complexity: "easy", + categories: [], + description: "testing question", + }; + + await axios.post(url, params, header); + + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(401) + expect(error.response.data).toBe("not a maintainer!") + } + + }); \ No newline at end of file From d022439a79712aeaa60dfde8500e9d71f99bda86 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Sat, 4 Nov 2023 15:16:50 +0800 Subject: [PATCH 17/26] Add testing on local and test environment --- tests/matchmaking-service/find.test.js | 46 +++++++++++++++++++++ tests/package.json | 7 +++- tests/questions-service/question.test.js | 4 +- tests/setEnvVars.js | 28 +++++-------- tests/yarn.lock | 51 +++++++++++++++++++++++- 5 files changed, 113 insertions(+), 23 deletions(-) create mode 100644 tests/matchmaking-service/find.test.js diff --git a/tests/matchmaking-service/find.test.js b/tests/matchmaking-service/find.test.js new file mode 100644 index 00000000..87668645 --- /dev/null +++ b/tests/matchmaking-service/find.test.js @@ -0,0 +1,46 @@ +const axios = require('axios'); +const { io } = require("socket.io-client"); + +const TEST_NAME = "Carl Colin"; +const TEST_EMAIL = "carl@example.com"; +const TEST_PWD = "carl123"; + +let token; + +beforeEach(async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { + name: TEST_NAME, + email: TEST_EMAIL, + password: TEST_PWD, + }); + } catch (error) { + } + + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { + email: TEST_EMAIL, + password: TEST_PWD, + }); + + token = response.data.token +}); + +afterEach(async () => { + await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { + headers: { + Authorization: token, + }, + }); +}); + +test('Send matchmaking request for easy question', async () => { + try { + const socket = io(`${process.env.REACT_APP_MATCHMAKING_SERVICE_HOST}`, { + query: { difficulty: "asy", token }, + path: "/api/matchmaking-service", + }); + console.log(socket); + } catch (err) { + console.log(err); + } +}) diff --git a/tests/package.json b/tests/package.json index beb2e7db..8dba565f 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,10 +1,13 @@ { "dependencies": { "axios": "^1.6.0", - "jest": "^29.7.0" + "jest": "^29.7.0", + "socket.io-client": "^4.7.2" }, "scripts": { - "test": "yarn test:users-service && yarn test:questions-service", + "test": "NODE_ENV=test yarn test:all-services", + "test:dev": "NODE_ENV=dev yarn test:all-services", + "test:all-services": "yarn test:users-service && yarn test:questions-service", "test:users-service": "jest users-service --runInBand", "test:questions-service": "jest questions-service --runInBand" }, diff --git a/tests/questions-service/question.test.js b/tests/questions-service/question.test.js index 873cb782..c9174d14 100644 --- a/tests/questions-service/question.test.js +++ b/tests/questions-service/question.test.js @@ -40,7 +40,7 @@ test('Get one questions', async () => { { headers: { Authorization: token }} ); expect(response.status).toBe(200); - expect(response.data.question_id).toBe(1); + expect(response.data).not.toBeNull(); }); test('Add new questions without maintainer permission', async () => { @@ -63,6 +63,4 @@ test('Add new questions without maintainer permission', async () => { expect(error.response.status).toBe(401) expect(error.response.data).toBe("not a maintainer!") } - - }); \ No newline at end of file diff --git a/tests/setEnvVars.js b/tests/setEnvVars.js index ef26000d..0c247fab 100644 --- a/tests/setEnvVars.js +++ b/tests/setEnvVars.js @@ -1,17 +1,11 @@ -// Development -// process.env.REACT_APP_QUESTIONS_SERVICE_HOST="http://localhost:3001"; -// process.env.REACT_APP_USERS_SERVICE_HOST="http://localhost:3002"; -// process.env.REACT_APP_MATCHMAKING_SERVICE_HOST="http://localhost:3003"; -// process.env.REACT_APP_COLLABORATION_SERVICE_HOST="http://localhost:3004"; - -// Testing -process.env.REACT_APP_QUESTIONS_SERVICE_HOST="http://peerpreptest.bryanlohxz.com/api/questions-service"; -process.env.REACT_APP_USERS_SERVICE_HOST="http://peerpreptest.bryanlohxz.com/api/users-service"; -process.env.REACT_APP_MATCHMAKING_SERVICE_HOST="http://peerpreptest.bryanlohxz.com/api/matchmaking-service"; -process.env.REACT_APP_COLLABORATION_SERVICE_HOST="http://peerpreptest.bryanlohxz.com/api/collaboration-service"; - -// Production -// process.env.REACT_APP_QUESTIONS_SERVICE_HOST="http://peerprep.bryanlohxz.com/api/questions-service"; -// process.env.REACT_APP_USERS_SERVICE_HOST="http://peerprep.bryanlohxz.com/api/users-service"; -// process.env.REACT_APP_MATCHMAKING_SERVICE_HOST="http://peerprep.bryanlohxz.com/api/matchmaking-service"; -// process.env.REACT_APP_COLLABORATION_SERVICE_HOST="http://peerprep.bryanlohxz.com/api/collaboration-service"; +if (process.env.NODE_ENV === 'test') { + process.env.REACT_APP_QUESTIONS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/questions-service"; + process.env.REACT_APP_USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service"; + process.env.REACT_APP_MATCHMAKING_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/matchmaking-service"; + process.env.REACT_APP_COLLABORATION_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/collaboration-service"; +} else { + process.env.REACT_APP_QUESTIONS_SERVICE_HOST = "http://localhost:3001"; + process.env.REACT_APP_USERS_SERVICE_HOST = "http://localhost:3002"; + process.env.REACT_APP_MATCHMAKING_SERVICE_HOST = "http://localhost:3003"; + process.env.REACT_APP_COLLABORATION_SERVICE_HOST = "http://localhost:3004"; +} diff --git a/tests/yarn.lock b/tests/yarn.lock index bc2fd019..28658ff1 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -556,6 +556,11 @@ dependencies: "@sinonjs/commons" "^3.0.0" +"@socket.io/component-emitter@~3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553" + integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg== + "@types/babel__core@^7.1.14": version "7.20.3" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.3.tgz#d5625a50b6f18244425a1359a858c73d70340778" @@ -935,7 +940,7 @@ cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -debug@^4.1.0, debug@^4.1.1: +debug@^4.1.0, debug@^4.1.1, debug@~4.3.1, debug@~4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -982,6 +987,22 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +engine.io-client@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-6.5.2.tgz#8709e22c291d4297ae80318d3c8baeae71f0e002" + integrity sha512-CQZqbrpEYnrpGqC07a9dJDz4gePZUgTPMU3NKJPSeQOyw27Tst4Pl3FemKoFGAlHzgZmKjoRmiJvbWfhCXUlIg== + dependencies: + "@socket.io/component-emitter" "~3.1.0" + debug "~4.3.1" + engine.io-parser "~5.2.1" + ws "~8.11.0" + xmlhttprequest-ssl "~2.0.0" + +engine.io-parser@~5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.2.1.tgz#9f213c77512ff1a6cc0c7a86108a7ffceb16fcfb" + integrity sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ== + error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -1980,6 +2001,24 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== +socket.io-client@^4.7.2: + version "4.7.2" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.7.2.tgz#f2f13f68058bd4e40f94f2a1541f275157ff2c08" + integrity sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w== + dependencies: + "@socket.io/component-emitter" "~3.1.0" + debug "~4.3.2" + engine.io-client "~6.5.2" + socket.io-parser "~4.2.4" + +socket.io-parser@~4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.2.4.tgz#c806966cf7270601e47469ddeec30fbdfda44c83" + integrity sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew== + dependencies: + "@socket.io/component-emitter" "~3.1.0" + debug "~4.3.1" + source-map-support@0.5.13: version "0.5.13" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" @@ -2164,6 +2203,16 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" +ws@~8.11.0: + version "8.11.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" + integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg== + +xmlhttprequest-ssl@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz#91360c86b914e67f44dce769180027c0da618c67" + integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" From 0c712be03a8a140093116bab38cf1f91a48cc0b0 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Tue, 7 Nov 2023 16:46:01 +0800 Subject: [PATCH 18/26] Add users-service test script --- tests/package.json | 2 +- tests/setEnvVars.js | 12 ++++++------ tests/test-users-service.sh | 7 +++++++ tests/users-service/login.test.js | 19 +++++++++++++++---- 4 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 tests/test-users-service.sh diff --git a/tests/package.json b/tests/package.json index 8dba565f..a4264fae 100644 --- a/tests/package.json +++ b/tests/package.json @@ -8,7 +8,7 @@ "test": "NODE_ENV=test yarn test:all-services", "test:dev": "NODE_ENV=dev yarn test:all-services", "test:all-services": "yarn test:users-service && yarn test:questions-service", - "test:users-service": "jest users-service --runInBand", + "test:users-service": "bash test-users-service.sh", "test:questions-service": "jest questions-service --runInBand" }, "jest": { diff --git a/tests/setEnvVars.js b/tests/setEnvVars.js index 0c247fab..680b0e07 100644 --- a/tests/setEnvVars.js +++ b/tests/setEnvVars.js @@ -1,11 +1,11 @@ -if (process.env.NODE_ENV === 'test') { - process.env.REACT_APP_QUESTIONS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/questions-service"; - process.env.REACT_APP_USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service"; - process.env.REACT_APP_MATCHMAKING_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/matchmaking-service"; - process.env.REACT_APP_COLLABORATION_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/collaboration-service"; -} else { +if (process.env.NODE_ENV === 'dev') { process.env.REACT_APP_QUESTIONS_SERVICE_HOST = "http://localhost:3001"; process.env.REACT_APP_USERS_SERVICE_HOST = "http://localhost:3002"; process.env.REACT_APP_MATCHMAKING_SERVICE_HOST = "http://localhost:3003"; process.env.REACT_APP_COLLABORATION_SERVICE_HOST = "http://localhost:3004"; +} else { + process.env.REACT_APP_QUESTIONS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/questions-service"; + process.env.REACT_APP_USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service"; + process.env.REACT_APP_MATCHMAKING_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/matchmaking-service"; + process.env.REACT_APP_COLLABORATION_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/collaboration-service"; } diff --git a/tests/test-users-service.sh b/tests/test-users-service.sh new file mode 100644 index 00000000..c2a35c0d --- /dev/null +++ b/tests/test-users-service.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +cd users-service +test_files=("signUp.test.js" "login.test.js" "delete.test.js" "update.test.js") +for file in "${test_files[@]}"; do + yarn jest "$file" +done diff --git a/tests/users-service/login.test.js b/tests/users-service/login.test.js index f78cbbe1..1c06203e 100644 --- a/tests/users-service/login.test.js +++ b/tests/users-service/login.test.js @@ -7,11 +7,13 @@ const { } = require("./errors.js"); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); -const TEST_NAME = "Adam Smith"; -const TEST_EMAIL = "adamsmith@example.com"; -const TEST_PWD = "adamSmith"; +const TEST_NAME = "John Doe"; +const TEST_EMAIL = "johndoe@example.com"; +const TEST_PWD = "john123"; -beforeAll(async () => { +let token; + +beforeEach(async () => { try { await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, @@ -22,6 +24,14 @@ beforeAll(async () => { } }); +afterAll(async () => { + await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { + headers: { + Authorization: token, + }, + }); +}); + describe('Login with invalid request body', () => { test('Login without password in request body', async () => { try { @@ -84,5 +94,6 @@ describe('Login successfully', () => { }); expect(response.status).toBe(200); expect(response.data.token).not.toBeNull(); + token = response.data.token }); }); \ No newline at end of file From 5101fd65cb8e5fe41754ec5997d87329b97e3735 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Tue, 7 Nov 2023 17:15:42 +0800 Subject: [PATCH 19/26] Abstract account credentials for tests --- tests/credentials.js | 5 +++++ tests/questions-service/question.test.js | 5 +---- tests/questions-service/questions.test.js | 4 +--- tests/users-service/delete.test.js | 5 +---- tests/users-service/login.test.js | 5 +---- tests/users-service/signUp.test.js | 5 +---- tests/users-service/update.test.js | 4 +--- 7 files changed, 11 insertions(+), 22 deletions(-) create mode 100644 tests/credentials.js diff --git a/tests/credentials.js b/tests/credentials.js new file mode 100644 index 00000000..d9e8b2f2 --- /dev/null +++ b/tests/credentials.js @@ -0,0 +1,5 @@ +module.exports = { + TEST_NAME: "John Doe", + TEST_EMAIL: "johndoe@example.com", + TEST_PWD: "john123" +}; \ No newline at end of file diff --git a/tests/questions-service/question.test.js b/tests/questions-service/question.test.js index c9174d14..be9fbf94 100644 --- a/tests/questions-service/question.test.js +++ b/tests/questions-service/question.test.js @@ -1,10 +1,7 @@ const axios = require('axios'); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); - -const TEST_NAME = "Blake Boris"; -const TEST_EMAIL = "blake@example.com"; -const TEST_PWD = "blake123"; +const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); let token; diff --git a/tests/questions-service/questions.test.js b/tests/questions-service/questions.test.js index 703e8c5c..9d09e846 100644 --- a/tests/questions-service/questions.test.js +++ b/tests/questions-service/questions.test.js @@ -1,8 +1,6 @@ const axios = require('axios'); -const TEST_NAME = "Mary Allan"; -const TEST_EMAIL = "maryallan@example.com"; -const TEST_PWD = "mary123"; +const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); let token; diff --git a/tests/users-service/delete.test.js b/tests/users-service/delete.test.js index 1c4d8a7d..9dc6ee81 100644 --- a/tests/users-service/delete.test.js +++ b/tests/users-service/delete.test.js @@ -3,10 +3,7 @@ const axios = require('axios'); const { INVALID_JWT_ERROR_MSG } = require("./errors.js"); - -const TEST_NAME = "Sophie Baker"; -const TEST_EMAIL = "sophiebaker@example.com"; -const TEST_PWD = "sophieBaker"; +const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); let token; diff --git a/tests/users-service/login.test.js b/tests/users-service/login.test.js index 1c06203e..850b4e31 100644 --- a/tests/users-service/login.test.js +++ b/tests/users-service/login.test.js @@ -6,10 +6,7 @@ const { USER_NOT_FOUND_MSG } = require("./errors.js"); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); - -const TEST_NAME = "John Doe"; -const TEST_EMAIL = "johndoe@example.com"; -const TEST_PWD = "john123"; +const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); let token; diff --git a/tests/users-service/signUp.test.js b/tests/users-service/signUp.test.js index 5a9fcb1e..841827d7 100644 --- a/tests/users-service/signUp.test.js +++ b/tests/users-service/signUp.test.js @@ -5,10 +5,7 @@ const { USER_WITH_SAME_EMAIL_FOUND_MSG } = require("./errors.js"); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); - -const TEST_NAME = "John Doe"; -const TEST_EMAIL = "johndoe@example.com"; -const TEST_PWD = "john123"; +const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); describe('Sign-up Successfully', () => { test('Sign up for new user profile successfully', async () => { diff --git a/tests/users-service/update.test.js b/tests/users-service/update.test.js index 10271d18..ea82de95 100644 --- a/tests/users-service/update.test.js +++ b/tests/users-service/update.test.js @@ -5,10 +5,8 @@ const { INVALID_REQUEST_BODY_ERROR_MESSAGE } = require("./errors.js"); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); +const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); -const TEST_NAME = "Frank Bell"; -const TEST_EMAIL = "frankbell@example.com"; -const TEST_PWD = "frank#!"; const UPDATED_NAME = "Frankie"; const IMAGE_URL = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png"; From 0970eeb4829d67fac3b7fc2aa6e76a25e797c362 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Tue, 7 Nov 2023 18:38:41 +0800 Subject: [PATCH 20/26] WIP Abstract out beforeEach and afterEach --- tests/credentials.js | 24 +++++++++++++--- tests/jest.config.js | 7 +++++ tests/package.json | 10 +++---- tests/questions-service/question.test.js | 31 ++------------------ tests/questions-service/questions.test.js | 33 +++------------------ tests/users-service/delete.test.js | 16 +++++------ tests/users-service/signUp.test.js | 14 ++++----- tests/users-service/update.test.js | 35 ++++------------------- tests/utils.js | 24 ++++++++++++++++ tests/yarn.lock | 5 ++++ 10 files changed, 87 insertions(+), 112 deletions(-) create mode 100644 tests/jest.config.js create mode 100644 tests/utils.js diff --git a/tests/credentials.js b/tests/credentials.js index d9e8b2f2..1556d091 100644 --- a/tests/credentials.js +++ b/tests/credentials.js @@ -1,5 +1,21 @@ +const { v4: uuid } = require("uuid"); + +const getUser = (isMaintainer) => { + if (isMaintainer) return MAINTAINER_USER; + const userId = uuid(); + return { + name: userId, + email: `${userId}@example.com`, + password: userId + } +} + +const MAINTAINER_USER = { + name: "Maintainer", + email: "maintainer@example.com", + password: "john123", +} + module.exports = { - TEST_NAME: "John Doe", - TEST_EMAIL: "johndoe@example.com", - TEST_PWD: "john123" -}; \ No newline at end of file + getUser +} \ No newline at end of file diff --git a/tests/jest.config.js b/tests/jest.config.js new file mode 100644 index 00000000..b9ea7b58 --- /dev/null +++ b/tests/jest.config.js @@ -0,0 +1,7 @@ +/** @type { import('jest').Config} */ +const config = { + setupFiles: ["/setEnvVars.js"], + transform: {} +} + +export default config; \ No newline at end of file diff --git a/tests/package.json b/tests/package.json index a4264fae..50745d95 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,19 +1,17 @@ { + "type": "module", "dependencies": { "axios": "^1.6.0", "jest": "^29.7.0", - "socket.io-client": "^4.7.2" + "socket.io-client": "^4.7.2", + "uuid": "^9.0.1" }, "scripts": { "test": "NODE_ENV=test yarn test:all-services", + "test:watch": "yarn test --watch", "test:dev": "NODE_ENV=dev yarn test:all-services", "test:all-services": "yarn test:users-service && yarn test:questions-service", "test:users-service": "bash test-users-service.sh", "test:questions-service": "jest questions-service --runInBand" - }, - "jest": { - "setupFiles": [ - "/setEnvVars.js" - ] } } diff --git a/tests/questions-service/question.test.js b/tests/questions-service/question.test.js index be9fbf94..8d0a22fd 100644 --- a/tests/questions-service/question.test.js +++ b/tests/questions-service/question.test.js @@ -1,35 +1,10 @@ const axios = require('axios'); - const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); -const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); +const { signUpAndLogin, deleteUserWithToken } = require("../utils.js") let token; - -beforeEach(async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, - email: TEST_EMAIL, - password: TEST_PWD, - }); - } catch (error) { - } - - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: TEST_PWD, - }); - - token = response.data.token -}); - -afterEach(async () => { - await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { - headers: { - Authorization: token, - }, - }); -}); +beforeEach(() => signUpAndLogin().then(({ token: t }) => token = t)); +afterEach(() => deleteUserWithToken(token)); test('Get one questions', async () => { const response = await axios.get( diff --git a/tests/questions-service/questions.test.js b/tests/questions-service/questions.test.js index 9d09e846..36fd7a61 100644 --- a/tests/questions-service/questions.test.js +++ b/tests/questions-service/questions.test.js @@ -1,34 +1,9 @@ -const axios = require('axios'); - -const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); +const axios = require("axios"); +const { signUpAndLogin, deleteUserWithToken } = require("../utils.js"); let token; - -beforeEach(async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, - email: TEST_EMAIL, - password: TEST_PWD, - }); - } catch (error) { - } - - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: TEST_PWD, - }); - - token = response.data.token -}); - -afterEach(async () => { - await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { - headers: { - Authorization: token, - }, - }); -}); +beforeEach(() => signUpAndLogin().then((t) => { token = t })); +afterEach(() => deleteUserWithToken(token)); test('Get all questions', async () => { const response = await axios.get( diff --git a/tests/users-service/delete.test.js b/tests/users-service/delete.test.js index 9dc6ee81..08a4756a 100644 --- a/tests/users-service/delete.test.js +++ b/tests/users-service/delete.test.js @@ -5,25 +5,23 @@ const { } = require("./errors.js"); const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); -let token; - -beforeAll(async () => { +const signUpAndLogin = async () => { try { await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: TEST_NAME, email: TEST_EMAIL, password: TEST_PWD, }); - } catch (error) { - } - + } catch (error) { /* Ignore the error */ } const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { email: TEST_EMAIL, password: TEST_PWD, }); - - token = response.data.token -}); + return response.data.token; +} + +let token; +beforeAll(() => signUpAndLogin().then((t) => token = t)); test('Delete user profile with unauthorized token', async () => { try { diff --git a/tests/users-service/signUp.test.js b/tests/users-service/signUp.test.js index 841827d7..f3b494d7 100644 --- a/tests/users-service/signUp.test.js +++ b/tests/users-service/signUp.test.js @@ -5,14 +5,14 @@ const { USER_WITH_SAME_EMAIL_FOUND_MSG } = require("./errors.js"); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); -const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); +const { TEST_USER } = require("../credentials.js"); describe('Sign-up Successfully', () => { test('Sign up for new user profile successfully', async () => { const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, - email: TEST_EMAIL, - password: TEST_PWD, + name: TEST_USER.name, + email: TEST_USER.email, + password: TEST_USER.password, }); expect(response.status).toBe(200) }); @@ -23,7 +23,7 @@ describe('Sign-up with existing email', () => { try { await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { name: 'Test User With Same Email', - email: TEST_EMAIL, + email: TEST_USER.email, password: 'testuser123', }); throw new Error(UNEXPECTED_SUCCESS_MSG); @@ -51,7 +51,7 @@ describe('Sign-up with invalid request body', () => { test('Sign up without email in request body', async () => { try { await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, + name: TEST_USER.name, password: 'test', }); throw new Error(UNEXPECTED_SUCCESS_MSG); @@ -64,7 +64,7 @@ describe('Sign-up with invalid request body', () => { test('Sign up without password in request body', async () => { try { await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, + name: TEST_USER.namep, email: 'test@example.com', }); throw new Error(UNEXPECTED_SUCCESS_MSG); diff --git a/tests/users-service/update.test.js b/tests/users-service/update.test.js index ea82de95..7bbe8ea8 100644 --- a/tests/users-service/update.test.js +++ b/tests/users-service/update.test.js @@ -1,42 +1,19 @@ const axios = require('axios'); +const { signUpAndLogin, deleteUserWithToken } = require("../utils.js"); const { INVALID_JWT_ERROR_MSG, INVALID_REQUEST_BODY_ERROR_MESSAGE } = require("./errors.js"); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); -const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); +const { TEST_USER } = require("../credentials.js"); const UPDATED_NAME = "Frankie"; const IMAGE_URL = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png"; let token; - -beforeEach(async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, - email: TEST_EMAIL, - password: TEST_PWD, - }); - } catch (error) { - } - - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: TEST_PWD, - }); - - token = response.data.token -}); - -afterEach(async () => { - await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { - headers: { - Authorization: token, - }, - }); -}); +beforeEach(() => signUpAndLogin().then((t) => { token = t })); +afterEach(() => deleteUserWithToken(token)); describe('View user profile', () => { test('Get profile with valid token', async () => { @@ -48,8 +25,8 @@ describe('View user profile', () => { expect(response.data).not.toBeNull() const user = response.data; - expect(user.name).toBe(TEST_NAME) - expect(user.email).toBe(TEST_EMAIL) + expect(user.name).toBe(TEST_USER.name) + expect(user.email).toBe(TEST_USER.email) expect(user.isMaintainer).toBeFalsy() }); diff --git a/tests/utils.js b/tests/utils.js new file mode 100644 index 00000000..ad7e3a9d --- /dev/null +++ b/tests/utils.js @@ -0,0 +1,24 @@ +const axios = require("axios"); +const { getUser } = require("./credentials.js"); + +const signUpAndLogin = async () => { + const user = getUser(false); + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, user); + } catch (error) { /* Ignore the error */ } + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { + email: user.email, + password: user.password, + }); + return { token: response.data.token, user }; +} + +const deleteUserWithToken = async (token) => { + const deleteUrl = `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`; + await axios.delete(deleteUrl, { headers: { Authorization: token } }); +} + +module.exports = { + deleteUserWithToken, + signUpAndLogin, +} diff --git a/tests/yarn.lock b/tests/yarn.lock index 28658ff1..c07503e3 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -2158,6 +2158,11 @@ update-browserslist-db@^1.0.13: escalade "^3.1.1" picocolors "^1.0.0" +uuid@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== + v8-to-istanbul@^9.0.1: version "9.1.3" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz#ea456604101cd18005ac2cae3cdd1aa058a6306b" From 868a2588acb1e888b4691651d9203cdb18a6654b Mon Sep 17 00:00:00 2001 From: gowribhat Date: Thu, 9 Nov 2023 01:25:39 +0800 Subject: [PATCH 21/26] Fix setup and teardown abstraction for all tests --- tests/matchmaking-service/find.test.js | 35 +----- tests/questions-service/questions.test.js | 4 +- tests/users-service/delete.test.js | 19 +-- tests/users-service/login.test.js | 96 -------------- tests/users-service/loginSignUp.test.js | 147 ++++++++++++++++++++++ tests/users-service/signUp.test.js | 86 ------------- tests/users-service/update.test.js | 10 +- 7 files changed, 160 insertions(+), 237 deletions(-) delete mode 100644 tests/users-service/login.test.js create mode 100644 tests/users-service/loginSignUp.test.js delete mode 100644 tests/users-service/signUp.test.js diff --git a/tests/matchmaking-service/find.test.js b/tests/matchmaking-service/find.test.js index 87668645..245cafb7 100644 --- a/tests/matchmaking-service/find.test.js +++ b/tests/matchmaking-service/find.test.js @@ -1,37 +1,11 @@ const axios = require('axios'); const { io } = require("socket.io-client"); +const { signUpAndLogin, deleteUserWithToken } = require("../utils.js"); -const TEST_NAME = "Carl Colin"; -const TEST_EMAIL = "carl@example.com"; -const TEST_PWD = "carl123"; - +let test_user; let token; - -beforeEach(async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, - email: TEST_EMAIL, - password: TEST_PWD, - }); - } catch (error) { - } - - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: TEST_PWD, - }); - - token = response.data.token -}); - -afterEach(async () => { - await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { - headers: { - Authorization: token, - }, - }); -}); +beforeAll(async () => signUpAndLogin().then((x) => { token = x.token, test_user = x.user })); +afterAll(() => deleteUserWithToken(token)); test('Send matchmaking request for easy question', async () => { try { @@ -39,7 +13,6 @@ test('Send matchmaking request for easy question', async () => { query: { difficulty: "asy", token }, path: "/api/matchmaking-service", }); - console.log(socket); } catch (err) { console.log(err); } diff --git a/tests/questions-service/questions.test.js b/tests/questions-service/questions.test.js index 36fd7a61..7a00b748 100644 --- a/tests/questions-service/questions.test.js +++ b/tests/questions-service/questions.test.js @@ -2,8 +2,8 @@ const axios = require("axios"); const { signUpAndLogin, deleteUserWithToken } = require("../utils.js"); let token; -beforeEach(() => signUpAndLogin().then((t) => { token = t })); -afterEach(() => deleteUserWithToken(token)); +beforeAll(() => signUpAndLogin().then((x) => { token = x.token })); +afterAll(() => deleteUserWithToken(token)); test('Get all questions', async () => { const response = await axios.get( diff --git a/tests/users-service/delete.test.js b/tests/users-service/delete.test.js index 08a4756a..f85c1c92 100644 --- a/tests/users-service/delete.test.js +++ b/tests/users-service/delete.test.js @@ -3,25 +3,10 @@ const axios = require('axios'); const { INVALID_JWT_ERROR_MSG } = require("./errors.js"); -const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); - -const signUpAndLogin = async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, - email: TEST_EMAIL, - password: TEST_PWD, - }); - } catch (error) { /* Ignore the error */ } - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: TEST_PWD, - }); - return response.data.token; -} +const { signUpAndLogin } = require("../utils.js") let token; -beforeAll(() => signUpAndLogin().then((t) => token = t)); +beforeAll(() => signUpAndLogin().then((x) => token = x.token)); test('Delete user profile with unauthorized token', async () => { try { diff --git a/tests/users-service/login.test.js b/tests/users-service/login.test.js deleted file mode 100644 index 850b4e31..00000000 --- a/tests/users-service/login.test.js +++ /dev/null @@ -1,96 +0,0 @@ -const axios = require('axios'); - -const { - INCORRECT_PASSWORD_MSG, - INVALID_REQUEST_BODY_ERROR_MESSAGE, - USER_NOT_FOUND_MSG -} = require("./errors.js"); -const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); -const { TEST_NAME, TEST_EMAIL, TEST_PWD } = require("../credentials.js"); - -let token; - -beforeEach(async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_NAME, - email: TEST_EMAIL, - password: TEST_PWD, - }); - } catch (error) { - } -}); - -afterAll(async () => { - await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { - headers: { - Authorization: token, - }, - }); -}); - -describe('Login with invalid request body', () => { - test('Login without password in request body', async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - }); - throw new Error(UNEXPECTED_SUCCESS_MSG); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); - } - }); - - test('Login without password in request body', async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - password: TEST_PWD, - }); - throw new Error(UNEXPECTED_SUCCESS_MSG); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); - } - }); -}); - -describe('Login with invalid credentials', () => { - test('Login with non-existant user email', async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: 'nonexistent@example.com', - password: TEST_PWD, - }); - throw new Error(UNEXPECTED_SUCCESS_MSG); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(USER_NOT_FOUND_MSG); - } - }); - - test('Login with incorrect password', async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: 'incorrectpassword', - }); - throw new Error(UNEXPECTED_SUCCESS_MSG); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INCORRECT_PASSWORD_MSG); - } - }); -}); - -describe('Login successfully', () => { - test('Login into PeerPrepTest', async () => { - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: TEST_EMAIL, - password: TEST_PWD, - }); - expect(response.status).toBe(200); - expect(response.data.token).not.toBeNull(); - token = response.data.token - }); -}); \ No newline at end of file diff --git a/tests/users-service/loginSignUp.test.js b/tests/users-service/loginSignUp.test.js new file mode 100644 index 00000000..0479a6fa --- /dev/null +++ b/tests/users-service/loginSignUp.test.js @@ -0,0 +1,147 @@ +const axios = require('axios'); + +const { + INCORRECT_PASSWORD_MSG, + INVALID_REQUEST_BODY_ERROR_MESSAGE, + USER_NOT_FOUND_MSG, + USER_WITH_SAME_EMAIL_FOUND_MSG +} = require("./errors.js"); +const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); +const { getUser } = require("../credentials.js"); +const test_user = getUser(false); +const { deleteUserWithToken } = require("../utils.js"); + +let token; +afterAll(() => deleteUserWithToken(token)); + +describe('Sign-up for new user account', () => { + test('Sign up successfully', async () => { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, test_user); + expect(response.status).toBe(200) + }); + + test('Sign up for with existing email', async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { + name: 'Test User With Same Email', + email: test_user.email, + password: 'testuser123', + }); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(USER_WITH_SAME_EMAIL_FOUND_MSG); + } + }); + + test('Sign up without name in request body', async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { + email: 'test@example.com', + password: 'test', + }); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); + + test('Sign up without email in request body', async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { + name: test_user.name, + password: 'test', + }); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); + + test('Sign up without password in request body', async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { + name: test_user.name, + email: 'test@example.com', + }); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); + + test('Sign up with empty request body', async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, {}); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); +}); + +describe('Login', () => { + test('Login without password in request body', async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { + email: test_user.email, + }); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); + + test('Login without email in request body', async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { + password: test_user.password, + }); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); + } + }); + + test('Login with non-existant user email', async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { + email: 'nonexistent@example.com', + password: test_user.password, + }); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(USER_NOT_FOUND_MSG); + } + }); + + test('Login with incorrect password', async () => { + try { + await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { + email: test_user.email, + password: 'incorrectpassword', + }); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(400); + expect(error.response.data).toBe(INCORRECT_PASSWORD_MSG); + } + }); + + test('Login into PeerPrepTest', async () => { + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { + email: test_user.email, + password: test_user.password, + }); + expect(response.status).toBe(200); + expect(response.data.token).not.toBeNull(); + token = response.data.token + }); +}); \ No newline at end of file diff --git a/tests/users-service/signUp.test.js b/tests/users-service/signUp.test.js deleted file mode 100644 index f3b494d7..00000000 --- a/tests/users-service/signUp.test.js +++ /dev/null @@ -1,86 +0,0 @@ -const axios = require('axios'); - -const { - INVALID_REQUEST_BODY_ERROR_MESSAGE, - USER_WITH_SAME_EMAIL_FOUND_MSG -} = require("./errors.js"); -const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); -const { TEST_USER } = require("../credentials.js"); - -describe('Sign-up Successfully', () => { - test('Sign up for new user profile successfully', async () => { - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_USER.name, - email: TEST_USER.email, - password: TEST_USER.password, - }); - expect(response.status).toBe(200) - }); -}); - -describe('Sign-up with existing email', () => { - test('Sign up for new user profile with existing email', async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: 'Test User With Same Email', - email: TEST_USER.email, - password: 'testuser123', - }); - throw new Error(UNEXPECTED_SUCCESS_MSG); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(USER_WITH_SAME_EMAIL_FOUND_MSG); - } - }); -}); - -describe('Sign-up with invalid request body', () => { - test('Sign up without name in request body', async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - email: 'test@example.com', - password: 'test', - }); - throw new Error(UNEXPECTED_SUCCESS_MSG); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); - } - }); - - test('Sign up without email in request body', async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_USER.name, - password: 'test', - }); - throw new Error(UNEXPECTED_SUCCESS_MSG); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); - } - }); - - test('Sign up without password in request body', async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: TEST_USER.namep, - email: 'test@example.com', - }); - throw new Error(UNEXPECTED_SUCCESS_MSG); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); - } - }); - - test('Sign up with empty request body', async () => { - try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, {}); - throw new Error(UNEXPECTED_SUCCESS_MSG); - } catch (error) { - expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); - } - }); -}); diff --git a/tests/users-service/update.test.js b/tests/users-service/update.test.js index 7bbe8ea8..f827d34a 100644 --- a/tests/users-service/update.test.js +++ b/tests/users-service/update.test.js @@ -6,14 +6,14 @@ const { INVALID_REQUEST_BODY_ERROR_MESSAGE } = require("./errors.js"); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); -const { TEST_USER } = require("../credentials.js"); const UPDATED_NAME = "Frankie"; const IMAGE_URL = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png"; +let test_user; let token; -beforeEach(() => signUpAndLogin().then((t) => { token = t })); -afterEach(() => deleteUserWithToken(token)); +beforeAll(async () => signUpAndLogin().then((x) => { token = x.token, test_user = x.user })); +afterAll(() => deleteUserWithToken(token)); describe('View user profile', () => { test('Get profile with valid token', async () => { @@ -25,8 +25,8 @@ describe('View user profile', () => { expect(response.data).not.toBeNull() const user = response.data; - expect(user.name).toBe(TEST_USER.name) - expect(user.email).toBe(TEST_USER.email) + expect(user.name).toBe(test_user.name) + expect(user.email).toBe(test_user.email) expect(user.isMaintainer).toBeFalsy() }); From 293cfc7d6732d74b8291331ca29262bd8dae00ec Mon Sep 17 00:00:00 2001 From: gowribhat Date: Thu, 9 Nov 2023 02:01:59 +0800 Subject: [PATCH 22/26] Clean up URLs --- tests/questions-service/question.test.js | 13 ++---- tests/questions-service/questions.test.js | 8 ++-- tests/users-service/delete.test.js | 21 +++------ tests/users-service/loginSignUp.test.js | 52 +++++++-------------- tests/users-service/update.test.js | 57 +++++++++-------------- 5 files changed, 50 insertions(+), 101 deletions(-) diff --git a/tests/questions-service/question.test.js b/tests/questions-service/question.test.js index 8d0a22fd..8082a537 100644 --- a/tests/questions-service/question.test.js +++ b/tests/questions-service/question.test.js @@ -1,23 +1,20 @@ const axios = require('axios'); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); const { signUpAndLogin, deleteUserWithToken } = require("../utils.js") +const questionsUrl = `${process.env.REACT_APP_QUESTIONS_SERVICE_HOST}/questions` let token; beforeEach(() => signUpAndLogin().then(({ token: t }) => token = t)); afterEach(() => deleteUserWithToken(token)); test('Get one questions', async () => { - const response = await axios.get( - `${process.env.REACT_APP_QUESTIONS_SERVICE_HOST}/questions/1`, - { headers: { Authorization: token }} - ); + const response = await axios.get(`${questionsUrl}/1`, { headers: { Authorization: token }}); expect(response.status).toBe(200); expect(response.data).not.toBeNull(); }); test('Add new questions without maintainer permission', async () => { try { - const url = `${process.env.REACT_APP_QUESTIONS_SERVICE_HOST}/questions`; const header = { headers: { Authorization: token }, }; @@ -27,12 +24,10 @@ test('Add new questions without maintainer permission', async () => { categories: [], description: "testing question", }; - - await axios.post(url, params, header); - + await axios.post(questionsUrl, params, header); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { - expect(error.response.status).toBe(401) + expect(error.response.status).toBe(401); expect(error.response.data).toBe("not a maintainer!") } }); \ No newline at end of file diff --git a/tests/questions-service/questions.test.js b/tests/questions-service/questions.test.js index 7a00b748..ce343a47 100644 --- a/tests/questions-service/questions.test.js +++ b/tests/questions-service/questions.test.js @@ -1,14 +1,12 @@ const axios = require("axios"); const { signUpAndLogin, deleteUserWithToken } = require("../utils.js"); +const questionsUrl = `${process.env.REACT_APP_QUESTIONS_SERVICE_HOST}/questions`; let token; beforeAll(() => signUpAndLogin().then((x) => { token = x.token })); afterAll(() => deleteUserWithToken(token)); test('Get all questions', async () => { - const response = await axios.get( - `${process.env.REACT_APP_QUESTIONS_SERVICE_HOST}/questions`, - { headers: { Authorization: token }} - ); - expect(response.status).toBe(200) + const response = await axios.get( questionsUrl, { headers: { Authorization: token }}); + expect(response.status).toBe(200); }); diff --git a/tests/users-service/delete.test.js b/tests/users-service/delete.test.js index f85c1c92..6778c240 100644 --- a/tests/users-service/delete.test.js +++ b/tests/users-service/delete.test.js @@ -1,9 +1,8 @@ const axios = require('axios'); -const { - INVALID_JWT_ERROR_MSG -} = require("./errors.js"); -const { signUpAndLogin } = require("../utils.js") +const { INVALID_JWT_ERROR_MSG } = require("./errors.js"); +const { signUpAndLogin } = require("../utils.js"); +const profileUrl = `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`; let token; beforeAll(() => signUpAndLogin().then((x) => token = x.token)); @@ -11,23 +10,15 @@ beforeAll(() => signUpAndLogin().then((x) => token = x.token)); test('Delete user profile with unauthorized token', async () => { try { const unauthorizedToken = 'invalid-token'; - const response = await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { - headers: { - Authorization: unauthorizedToken, - }, - }); + await axios.delete(profileUrl, { headers: { Authorization: unauthorizedToken }}); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(401); - expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) + expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG); } }); test('Delete user profile with a valid token', async () => { - const response = await axios.delete(`${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, { - headers: { - Authorization: token, - }, - }); + const response = await axios.delete(profileUrl, { headers: { Authorization: token }}); expect(response.status).toBe(200); }); \ No newline at end of file diff --git a/tests/users-service/loginSignUp.test.js b/tests/users-service/loginSignUp.test.js index 0479a6fa..f950156a 100644 --- a/tests/users-service/loginSignUp.test.js +++ b/tests/users-service/loginSignUp.test.js @@ -10,20 +10,22 @@ const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); const { getUser } = require("../credentials.js"); const test_user = getUser(false); const { deleteUserWithToken } = require("../utils.js"); +const signupUrl = `${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`; +const loginUrl = `${process.env.REACT_APP_USERS_SERVICE_HOST}/login`; let token; afterAll(() => deleteUserWithToken(token)); describe('Sign-up for new user account', () => { test('Sign up successfully', async () => { - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, test_user); - expect(response.status).toBe(200) + const response = await axios.post(signupUrl, test_user); + expect(response.status).toBe(200); }); test('Sign up for with existing email', async () => { try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: 'Test User With Same Email', + await axios.post(signupUrl, { + name: 'Test User', email: test_user.email, password: 'testuser123', }); @@ -36,10 +38,7 @@ describe('Sign-up for new user account', () => { test('Sign up without name in request body', async () => { try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - email: 'test@example.com', - password: 'test', - }); + await axios.post(signupUrl, { email: 'test@example.com', password: 'test' }); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); @@ -49,10 +48,7 @@ describe('Sign-up for new user account', () => { test('Sign up without email in request body', async () => { try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: test_user.name, - password: 'test', - }); + await axios.post(signupUrl, { name: test_user.name, password: 'test' }); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); @@ -62,10 +58,7 @@ describe('Sign-up for new user account', () => { test('Sign up without password in request body', async () => { try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, { - name: test_user.name, - email: 'test@example.com', - }); + await axios.post(signupUrl, { name: test_user.name, email: 'test@example.com' }); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); @@ -75,7 +68,7 @@ describe('Sign-up for new user account', () => { test('Sign up with empty request body', async () => { try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/signup`, {}); + await axios.post(signupUrl, {}); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); @@ -87,9 +80,7 @@ describe('Sign-up for new user account', () => { describe('Login', () => { test('Login without password in request body', async () => { try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: test_user.email, - }); + await axios.post(loginUrl, { email: test_user.email }); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); @@ -99,9 +90,7 @@ describe('Login', () => { test('Login without email in request body', async () => { try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - password: test_user.password, - }); + await axios.post(loginUrl, { password: test_user.password }); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); @@ -111,10 +100,7 @@ describe('Login', () => { test('Login with non-existant user email', async () => { try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: 'nonexistent@example.com', - password: test_user.password, - }); + await axios.post(loginUrl, { email: 'nonexistent@example.com', password: test_user.password }); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); @@ -124,10 +110,7 @@ describe('Login', () => { test('Login with incorrect password', async () => { try { - await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: test_user.email, - password: 'incorrectpassword', - }); + await axios.post(loginUrl, { email: test_user.email, password: 'incorrectpassword' }); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); @@ -136,12 +119,9 @@ describe('Login', () => { }); test('Login into PeerPrepTest', async () => { - const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { - email: test_user.email, - password: test_user.password, - }); + const response = await axios.post(loginUrl, { email: test_user.email, password: test_user.password }); expect(response.status).toBe(200); expect(response.data.token).not.toBeNull(); - token = response.data.token + token = response.data.token; }); }); \ No newline at end of file diff --git a/tests/users-service/update.test.js b/tests/users-service/update.test.js index f827d34a..aa1a61bd 100644 --- a/tests/users-service/update.test.js +++ b/tests/users-service/update.test.js @@ -6,7 +6,7 @@ const { INVALID_REQUEST_BODY_ERROR_MESSAGE } = require("./errors.js"); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); - +const profileUrl = `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`; const UPDATED_NAME = "Frankie"; const IMAGE_URL = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/User_icon-cp.svg/828px-User_icon-cp.svg.png"; @@ -17,40 +17,32 @@ afterAll(() => deleteUserWithToken(token)); describe('View user profile', () => { test('Get profile with valid token', async () => { - const response = await axios.get( - `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, - { headers: { Authorization: token }} - ); + const response = await axios.get(profileUrl, { headers: { Authorization: token }}); expect(response.status).toBe(200); - expect(response.data).not.toBeNull() + expect(response.data).not.toBeNull(); const user = response.data; - expect(user.name).toBe(test_user.name) - expect(user.email).toBe(test_user.email) - expect(user.isMaintainer).toBeFalsy() + expect(user.name).toBe(test_user.name); + expect(user.email).toBe(test_user.email); + expect(user.isMaintainer).toBeFalsy(); }); test('Get profile with invalid token', async () => { try { - await axios.get( - `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, - { headers: { Authorization: "invalid-token" } - }); + await axios.get(profileUrl, { headers: { Authorization: "invalid-token" }}); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(401); - expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) + expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG); } }); }); describe('Update user profile successfully', () => { test('Update profile successfully', async () => { - const response = await axios.put( - `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, - { name: UPDATED_NAME, profileImageUrl: IMAGE_URL }, - { headers: { Authorization: token } } - ); + const params = { name: UPDATED_NAME, profileImageUrl: IMAGE_URL }; + const header = { headers: { Authorization: token }}; + const response = await axios.put(profileUrl, params, header); expect(response.status).toBe(200); }); }); @@ -58,15 +50,13 @@ describe('Update user profile successfully', () => { describe('Update user profile with invalid token', () => { test('Update profile with invalid token', async () => { try { - await axios.put( - `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, - { name: UPDATED_NAME, profileImageUrl: IMAGE_URL }, - { headers: { Authorization: "invalid-token" } } - ); + const params = { name: UPDATED_NAME, profileImageUrl: IMAGE_URL }; + const header = { headers: { Authorization: "invalid-token" }}; + await axios.put(profileUrl, params, header); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(401); - expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG) + expect(error.response.data).toBe(INVALID_JWT_ERROR_MSG); } }); }); @@ -74,29 +64,24 @@ describe('Update user profile with invalid token', () => { describe('Update user profile invalid request body', () => { test('Update profile without name', async () => { try { - await axios.put( - `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, - { profileImageUrl: IMAGE_URL }, - { headers: { Authorization: token } } - ); + const params = { profileImageUrl: IMAGE_URL }; + const header = { headers: { Authorization: token }}; + await axios.put(profileUrl, params, header); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE) + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); } }); test('Update profile with empty request body', async () => { try { - await axios.put( - `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`, - {}, - { headers: { Authorization: token } } + await axios.put( profileUrl, {}, { headers: { Authorization: token } } ); throw new Error(UNEXPECTED_SUCCESS_MSG); } catch (error) { expect(error.response.status).toBe(400); - expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE) + expect(error.response.data).toBe(INVALID_REQUEST_BODY_ERROR_MESSAGE); } }); }); \ No newline at end of file From 8e61181d0045b1696769d1afd120a1ec1515a456 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Thu, 9 Nov 2023 02:06:38 +0800 Subject: [PATCH 23/26] Clean up test scripts --- tests/package.json | 7 ++----- tests/test-users-service.sh | 7 ------- 2 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 tests/test-users-service.sh diff --git a/tests/package.json b/tests/package.json index 50745d95..f128a92d 100644 --- a/tests/package.json +++ b/tests/package.json @@ -7,11 +7,8 @@ "uuid": "^9.0.1" }, "scripts": { - "test": "NODE_ENV=test yarn test:all-services", + "test": "jest", "test:watch": "yarn test --watch", - "test:dev": "NODE_ENV=dev yarn test:all-services", - "test:all-services": "yarn test:users-service && yarn test:questions-service", - "test:users-service": "bash test-users-service.sh", - "test:questions-service": "jest questions-service --runInBand" + "test:dev": "NODE_ENV=dev yarn test" } } diff --git a/tests/test-users-service.sh b/tests/test-users-service.sh deleted file mode 100644 index c2a35c0d..00000000 --- a/tests/test-users-service.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -cd users-service -test_files=("signUp.test.js" "login.test.js" "delete.test.js" "update.test.js") -for file in "${test_files[@]}"; do - yarn jest "$file" -done From f3793370258a8a7134f6c7494e24e22ca8914289 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Fri, 10 Nov 2023 16:25:15 +0800 Subject: [PATCH 24/26] Add maintainer CRUD questions tests --- tests/credentials.js | 4 +- tests/questions-service/question.test.js | 154 +++++++++++++++++++---- tests/setEnvVars.js | 8 +- tests/utils.js | 10 ++ 4 files changed, 149 insertions(+), 27 deletions(-) diff --git a/tests/credentials.js b/tests/credentials.js index 1556d091..e92ceb66 100644 --- a/tests/credentials.js +++ b/tests/credentials.js @@ -12,8 +12,8 @@ const getUser = (isMaintainer) => { const MAINTAINER_USER = { name: "Maintainer", - email: "maintainer@example.com", - password: "john123", + email: "maintainer@email.com", + password: "maintainer", } module.exports = { diff --git a/tests/questions-service/question.test.js b/tests/questions-service/question.test.js index 8082a537..fcc13895 100644 --- a/tests/questions-service/question.test.js +++ b/tests/questions-service/question.test.js @@ -1,33 +1,145 @@ const axios = require('axios'); const { UNEXPECTED_SUCCESS_MSG } = require("../errors.js"); -const { signUpAndLogin, deleteUserWithToken } = require("../utils.js") +const { signUpAndLogin, loginAsMaintainer, deleteUserWithToken } = require("../utils.js") const questionsUrl = `${process.env.REACT_APP_QUESTIONS_SERVICE_HOST}/questions` -let token; -beforeEach(() => signUpAndLogin().then(({ token: t }) => token = t)); -afterEach(() => deleteUserWithToken(token)); +let normalToken; +let maintainerToken; +beforeAll(async () => { + await signUpAndLogin().then((x) => normalToken = x.token); + await loginAsMaintainer().then((x) => maintainerToken = x.token) +}); +afterAll(async () => { + deleteUserWithToken(normalToken); +}); + +describe('Non-maintainer actions', () => { + test('Get one questions', async () => { + const response = await axios.get(`${questionsUrl}/1`, { headers: { Authorization: normalToken }}); + expect(response.status).toBe(200); + expect(response.data).not.toBeNull(); + }); + + test('Add a new question without maintainer permission', async () => { + try { + const header = { + headers: { Authorization: normalToken }, + }; + const params = { + title: "New Question", + complexity: "easy", + categories: [], + description: "testing question", + }; + await axios.post(questionsUrl, params, header); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(401); + expect(error.response.data).toBe("not a maintainer!") + } + }); -test('Get one questions', async () => { - const response = await axios.get(`${questionsUrl}/1`, { headers: { Authorization: token }}); - expect(response.status).toBe(200); - expect(response.data).not.toBeNull(); + test('Edit existing question without maintainer permission', async () => { + try { + const header = { + headers: { Authorization: normalToken }, + }; + const params = { + title: "Edited Question", + complexity: "easy", + categories: [], + description: "Editing question description", + }; + await axios.put(`${questionsUrl}/1`, params, header); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(401); + expect(error.response.data).toBe("not a maintainer!") + } + }); + + test('Delete existing question without maintainer permission', async () => { + try { + const header = { + headers: { Authorization: normalToken }, + }; + await axios.delete(`${questionsUrl}/1`, header); + throw new Error(UNEXPECTED_SUCCESS_MSG); + } catch (error) { + expect(error.response.status).toBe(401); + expect(error.response.data).toBe("not a maintainer!") + } + }); }); -test('Add new questions without maintainer permission', async () => { - try { +describe('Maintainer actions', () => { + let questionId; + let questionTitle; + let questionComplexity; + let questionCategories; + let questionDescription; + test('Get one questions', async () => { + const response = await axios.get(`${questionsUrl}/1`, { headers: { Authorization: maintainerToken }}); + expect(response.status).toBe(200); + expect(response.data).not.toBeNull(); + }); + + test('Add a new question', async () => { + const header = { + headers: { Authorization: maintainerToken }, + }; + questionTitle = "Question Added"; + questionComplexity = "easy"; + questionCategories = []; + questionDescription = "Test description" + const params = { + title: questionTitle, + complexity: questionComplexity, + categories: questionCategories, + description: questionDescription, + }; + const response = await axios.post(questionsUrl, params, header); + expect(response.status).toBe(200); + expect(response.data.title).toBe(questionTitle); + expect(response.data.complexity).toBe(questionComplexity); + expect(response.data.categories).toStrictEqual(questionCategories); + expect(response.data.description).toBe(questionDescription); + expect(response.data.question_id).not.toBeNull(); + questionId = response.data.question_id; + }); + + test('Edit existing question', async () => { const header = { - headers: { Authorization: token }, + headers: { Authorization: maintainerToken }, }; + questionTitle = "Question Edited"; + questionComplexity = "hard"; + questionDescription = "Test description edited" const params = { - title: "New Question", - complexity: "easy", - categories: [], - description: "testing question", + title: questionTitle, + complexity: questionComplexity, + categories: questionCategories, + description: questionDescription, + }; + response = await axios.put(`${questionsUrl}/${questionId}`, params, header); + expect(response.status).toBe(200); + expect(response.data.title).toBe(questionTitle); + expect(response.data.complexity).toBe(questionComplexity); + expect(response.data.categories).toStrictEqual(questionCategories); + expect(response.data.description).toBe(questionDescription); + expect(response.data.question_id).not.toBeNull(); + }); + + test('Delete existing question', async () => { + const header = { + headers: { Authorization: maintainerToken }, }; - await axios.post(questionsUrl, params, header); - throw new Error(UNEXPECTED_SUCCESS_MSG); - } catch (error) { - expect(error.response.status).toBe(401); - expect(error.response.data).toBe("not a maintainer!") - } + const response = await axios.delete(`${questionsUrl}/${questionId}`, header); + expect(response.status).toBe(200); + expect(response.data.title).toBe(questionTitle); + expect(response.data.complexity).toBe(questionComplexity); + expect(response.data.categories).toStrictEqual(questionCategories); + expect(response.data.description).toBe(questionDescription); + expect(response.data.question_id).not.toBeNull(); + }); }); \ No newline at end of file diff --git a/tests/setEnvVars.js b/tests/setEnvVars.js index 680b0e07..833c18a9 100644 --- a/tests/setEnvVars.js +++ b/tests/setEnvVars.js @@ -4,8 +4,8 @@ if (process.env.NODE_ENV === 'dev') { process.env.REACT_APP_MATCHMAKING_SERVICE_HOST = "http://localhost:3003"; process.env.REACT_APP_COLLABORATION_SERVICE_HOST = "http://localhost:3004"; } else { - process.env.REACT_APP_QUESTIONS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/questions-service"; - process.env.REACT_APP_USERS_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/users-service"; - process.env.REACT_APP_MATCHMAKING_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/matchmaking-service"; - process.env.REACT_APP_COLLABORATION_SERVICE_HOST = "http://peerpreptest.bryanlohxz.com/api/collaboration-service"; + process.env.REACT_APP_QUESTIONS_SERVICE_HOST = "https://peerpreptest.bryanlohxz.com/api/questions-service"; + process.env.REACT_APP_USERS_SERVICE_HOST = "https://peerpreptest.bryanlohxz.com/api/users-service"; + process.env.REACT_APP_MATCHMAKING_SERVICE_HOST = "https://peerpreptest.bryanlohxz.com/api/matchmaking-service"; + process.env.REACT_APP_COLLABORATION_SERVICE_HOST = "https://peerpreptest.bryanlohxz.com/api/collaboration-service"; } diff --git a/tests/utils.js b/tests/utils.js index ad7e3a9d..46c7a57b 100644 --- a/tests/utils.js +++ b/tests/utils.js @@ -13,6 +13,15 @@ const signUpAndLogin = async () => { return { token: response.data.token, user }; } +const loginAsMaintainer = async () => { + const user = getUser(true); + const response = await axios.post(`${process.env.REACT_APP_USERS_SERVICE_HOST}/login`, { + email: user.email, + password: user.password, + }); + return { token: response.data.token, user }; +} + const deleteUserWithToken = async (token) => { const deleteUrl = `${process.env.REACT_APP_USERS_SERVICE_HOST}/profile`; await axios.delete(deleteUrl, { headers: { Authorization: token } }); @@ -21,4 +30,5 @@ const deleteUserWithToken = async (token) => { module.exports = { deleteUserWithToken, signUpAndLogin, + loginAsMaintainer } From 6e885f54059c5ee5528f6f89288c7fd07dd78de3 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Mon, 13 Nov 2023 22:33:48 +0800 Subject: [PATCH 25/26] Remove matchmaking test --- tests/matchmaking-service/find.test.js | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 tests/matchmaking-service/find.test.js diff --git a/tests/matchmaking-service/find.test.js b/tests/matchmaking-service/find.test.js deleted file mode 100644 index 245cafb7..00000000 --- a/tests/matchmaking-service/find.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const axios = require('axios'); -const { io } = require("socket.io-client"); -const { signUpAndLogin, deleteUserWithToken } = require("../utils.js"); - -let test_user; -let token; -beforeAll(async () => signUpAndLogin().then((x) => { token = x.token, test_user = x.user })); -afterAll(() => deleteUserWithToken(token)); - -test('Send matchmaking request for easy question', async () => { - try { - const socket = io(`${process.env.REACT_APP_MATCHMAKING_SERVICE_HOST}`, { - query: { difficulty: "asy", token }, - path: "/api/matchmaking-service", - }); - } catch (err) { - console.log(err); - } -}) From 94125e5bc784842599779522a740fadf06e8d7b6 Mon Sep 17 00:00:00 2001 From: gowribhat Date: Mon, 13 Nov 2023 22:43:04 +0800 Subject: [PATCH 26/26] Add workflow for running tests --- .github/workflows/run-tests.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/run-tests.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 00000000..cfca94a7 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,22 @@ +name: Run tests on PeerPrepTest + +on: + workflow_dispatch: {} + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: tests + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: master + + - name: Install dependencies + run: yarn install --frozen-lockfile --production=false + + - name: Run all tests + run: yarn test