diff --git a/client/package-lock.json b/client/package-lock.json index b208096c6..c729c05d7 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -85,7 +85,8 @@ "vite": "^4.5.0", "vite-aliases": "^0.11.3", "vite-plugin-node-polyfills": "^0.16.0", - "vite-plugin-svgr": "^4.2.0" + "vite-plugin-svgr": "^4.2.0", + "vitest": "^0.34.6" }, "engines": { "node": ">=16 <=16.20.2" @@ -1604,6 +1605,21 @@ "@types/node": "*" } }, + "node_modules/@types/chai": { + "version": "4.3.11", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.11.tgz", + "integrity": "sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==", + "dev": true + }, + "node_modules/@types/chai-subset": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.5.tgz", + "integrity": "sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==", + "dev": true, + "dependencies": { + "@types/chai": "*" + } + }, "node_modules/@types/classnames": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/@types/classnames/-/classnames-2.3.1.tgz", @@ -2279,6 +2295,101 @@ "node": ">=0.10.0" } }, + "node_modules/@vitest/expect": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.6.tgz", + "integrity": "sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==", + "dev": true, + "dependencies": { + "@vitest/spy": "0.34.6", + "@vitest/utils": "0.34.6", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.6.tgz", + "integrity": "sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==", + "dev": true, + "dependencies": { + "@vitest/utils": "0.34.6", + "p-limit": "^4.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/runner/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/snapshot": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.6.tgz", + "integrity": "sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.1", + "pathe": "^1.1.1", + "pretty-format": "^29.5.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.6.tgz", + "integrity": "sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==", + "dev": true, + "dependencies": { + "tinyspy": "^2.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", + "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.4.3", + "loupe": "^2.3.6", + "pretty-format": "^29.5.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -2312,6 +2423,15 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz", + "integrity": "sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/add-event-listener": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/add-event-listener/-/add-event-listener-0.0.1.tgz", @@ -2553,6 +2673,15 @@ "util": "^0.12.5" } }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -2949,6 +3078,15 @@ "node": ">= 0.8" } }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/call-bind": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", @@ -3028,6 +3166,24 @@ } ] }, + "node_modules/chai": { + "version": "4.3.10", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", + "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -3041,6 +3197,18 @@ "node": ">=4" } }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -3700,6 +3868,18 @@ "node": ">=0.10.0" } }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -5105,6 +5285,15 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/get-intrinsic": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", @@ -6489,6 +6678,12 @@ "node": ">=6" } }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "dev": true + }, "node_modules/jsonschema": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", @@ -6641,6 +6836,15 @@ "loose-envify": "cli.js" } }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -6964,6 +7168,18 @@ "node": ">= 6" } }, + "node_modules/mlly": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", + "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", + "dev": true, + "dependencies": { + "acorn": "^8.10.0", + "pathe": "^1.1.1", + "pkg-types": "^1.0.3", + "ufo": "^1.3.0" + } + }, "node_modules/moment": { "version": "2.29.4", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", @@ -7700,6 +7916,21 @@ "node": ">=8" } }, + "node_modules/pathe": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", + "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/pbkdf2": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", @@ -7767,6 +7998,17 @@ "node": ">=10" } }, + "node_modules/pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -8845,6 +9087,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -9047,6 +9295,12 @@ "node": ">=8" } }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -9055,6 +9309,12 @@ "node": ">= 0.8" } }, + "node_modules/std-env": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.5.0.tgz", + "integrity": "sha512-JGUEaALvL0Mf6JCfYnJOTcobY+Nc7sG/TemDRBqCA0wEr4DER7zDchaaixTlmOxAjG1uRJmX82EQcxwTQTkqVA==", + "dev": true + }, "node_modules/stream-browserify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", @@ -9224,6 +9484,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-literal": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", + "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "dev": true, + "dependencies": { + "acorn": "^8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/style-search": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", @@ -9657,6 +9929,30 @@ "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" }, + "node_modules/tinybench": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz", + "integrity": "sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.7.0.tgz", + "integrity": "sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", + "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -9777,6 +10073,15 @@ "node": ">= 0.8.0" } }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -9867,6 +10172,12 @@ "node": ">=4.2.0" } }, + "node_modules/ufo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", + "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==", + "dev": true + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -10109,6 +10420,29 @@ "node": ">=16.6.0" } }, + "node_modules/vite-node": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.6.tgz", + "integrity": "sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "mlly": "^1.4.0", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0-0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": ">=v14.18.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/vite-plugin-node-polyfills": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/vite-plugin-node-polyfills/-/vite-plugin-node-polyfills-0.16.0.tgz", @@ -10408,6 +10742,83 @@ "fsevents": "~2.3.2" } }, + "node_modules/vitest": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.6.tgz", + "integrity": "sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==", + "dev": true, + "dependencies": { + "@types/chai": "^4.3.5", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "@vitest/expect": "0.34.6", + "@vitest/runner": "0.34.6", + "@vitest/snapshot": "0.34.6", + "@vitest/spy": "0.34.6", + "@vitest/utils": "0.34.6", + "acorn": "^8.9.0", + "acorn-walk": "^8.2.0", + "cac": "^6.7.14", + "chai": "^4.3.10", + "debug": "^4.3.4", + "local-pkg": "^0.4.3", + "magic-string": "^0.30.1", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.3.3", + "strip-literal": "^1.0.1", + "tinybench": "^2.5.0", + "tinypool": "^0.7.0", + "vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0", + "vite-node": "0.34.6", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": ">=v14.18.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@vitest/browser": "*", + "@vitest/ui": "*", + "happy-dom": "*", + "jsdom": "*", + "playwright": "*", + "safaridriver": "*", + "webdriverio": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "playwright": { + "optional": true + }, + "safaridriver": { + "optional": true + }, + "webdriverio": { + "optional": true + } + } + }, "node_modules/vivagraphjs": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/vivagraphjs/-/vivagraphjs-0.12.0.tgz", @@ -10545,6 +10956,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -11754,6 +12181,21 @@ "@types/node": "*" } }, + "@types/chai": { + "version": "4.3.11", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.11.tgz", + "integrity": "sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==", + "dev": true + }, + "@types/chai-subset": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.5.tgz", + "integrity": "sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==", + "dev": true, + "requires": { + "@types/chai": "*" + } + }, "@types/classnames": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/@types/classnames/-/classnames-2.3.1.tgz", @@ -12311,6 +12753,76 @@ } } }, + "@vitest/expect": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.6.tgz", + "integrity": "sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==", + "dev": true, + "requires": { + "@vitest/spy": "0.34.6", + "@vitest/utils": "0.34.6", + "chai": "^4.3.10" + } + }, + "@vitest/runner": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.6.tgz", + "integrity": "sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==", + "dev": true, + "requires": { + "@vitest/utils": "0.34.6", + "p-limit": "^4.0.0", + "pathe": "^1.1.1" + }, + "dependencies": { + "p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "requires": { + "yocto-queue": "^1.0.0" + } + }, + "yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true + } + } + }, + "@vitest/snapshot": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.6.tgz", + "integrity": "sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==", + "dev": true, + "requires": { + "magic-string": "^0.30.1", + "pathe": "^1.1.1", + "pretty-format": "^29.5.0" + } + }, + "@vitest/spy": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.6.tgz", + "integrity": "sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==", + "dev": true, + "requires": { + "tinyspy": "^2.1.1" + } + }, + "@vitest/utils": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", + "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", + "dev": true, + "requires": { + "diff-sequences": "^29.4.3", + "loupe": "^2.3.6", + "pretty-format": "^29.5.0" + } + }, "accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -12333,6 +12845,12 @@ "dev": true, "requires": {} }, + "acorn-walk": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz", + "integrity": "sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==", + "dev": true + }, "add-event-listener": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/add-event-listener/-/add-event-listener-0.0.1.tgz", @@ -12524,6 +13042,12 @@ "util": "^0.12.5" } }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, "astral-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", @@ -12834,6 +13358,12 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, + "cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true + }, "call-bind": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", @@ -12880,6 +13410,21 @@ "integrity": "sha512-cPiMKZgqgkg5LY3/ntGeLFUpi6tzddBNS58A4tnTgQw1zON7u2sZMU7SzOeVH4tj20++9ggL+V6FDOFMTaFFYA==", "dev": true }, + "chai": { + "version": "4.3.10", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", + "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -12890,6 +13435,15 @@ "supports-color": "^5.3.0" } }, + "check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "requires": { + "get-func-name": "^2.0.2" + } + }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -13397,6 +13951,15 @@ } } }, + "deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -14495,6 +15058,12 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true + }, "get-intrinsic": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", @@ -15496,6 +16065,12 @@ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, + "jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "dev": true + }, "jsonschema": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", @@ -15614,6 +16189,15 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "requires": { + "get-func-name": "^2.0.1" + } + }, "lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -15859,6 +16443,18 @@ "kind-of": "^6.0.3" } }, + "mlly": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", + "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", + "dev": true, + "requires": { + "acorn": "^8.10.0", + "pathe": "^1.1.1", + "pkg-types": "^1.0.3", + "ufo": "^1.3.0" + } + }, "moment": { "version": "2.29.4", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", @@ -16445,6 +17041,18 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" }, + "pathe": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", + "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "dev": true + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, "pbkdf2": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", @@ -16491,6 +17099,17 @@ "find-up": "^5.0.0" } }, + "pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "requires": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, "pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -17283,6 +17902,12 @@ "object-inspect": "^1.9.0" } }, + "siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -17452,11 +18077,23 @@ } } }, + "stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, "statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, + "std-env": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.5.0.tgz", + "integrity": "sha512-JGUEaALvL0Mf6JCfYnJOTcobY+Nc7sG/TemDRBqCA0wEr4DER7zDchaaixTlmOxAjG1uRJmX82EQcxwTQTkqVA==", + "dev": true + }, "stream-browserify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", @@ -17592,6 +18229,15 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "strip-literal": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", + "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "dev": true, + "requires": { + "acorn": "^8.10.0" + } + }, "style-search": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", @@ -17954,6 +18600,24 @@ "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" }, + "tinybench": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz", + "integrity": "sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==", + "dev": true + }, + "tinypool": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.7.0.tgz", + "integrity": "sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==", + "dev": true + }, + "tinyspy": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", + "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", + "dev": true + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -18051,6 +18715,12 @@ "prelude-ls": "^1.2.1" } }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -18113,6 +18783,12 @@ "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, + "ufo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", + "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==", + "dev": true + }, "unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -18286,6 +18962,20 @@ "vite-aliases": "^0.11.2" } }, + "vite-node": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.6.tgz", + "integrity": "sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==", + "dev": true, + "requires": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "mlly": "^1.4.0", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0-0" + } + }, "vite-plugin-node-polyfills": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/vite-plugin-node-polyfills/-/vite-plugin-node-polyfills-0.16.0.tgz", @@ -18436,6 +19126,38 @@ } } }, + "vitest": { + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.6.tgz", + "integrity": "sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==", + "dev": true, + "requires": { + "@types/chai": "^4.3.5", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "@vitest/expect": "0.34.6", + "@vitest/runner": "0.34.6", + "@vitest/snapshot": "0.34.6", + "@vitest/spy": "0.34.6", + "@vitest/utils": "0.34.6", + "acorn": "^8.9.0", + "acorn-walk": "^8.2.0", + "cac": "^6.7.14", + "chai": "^4.3.10", + "debug": "^4.3.4", + "local-pkg": "^0.4.3", + "magic-string": "^0.30.1", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.3.3", + "strip-literal": "^1.0.1", + "tinybench": "^2.5.0", + "tinypool": "^0.7.0", + "vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0", + "vite-node": "0.34.6", + "why-is-node-running": "^2.2.2" + } + }, "vivagraphjs": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/vivagraphjs/-/vivagraphjs-0.12.0.tgz", @@ -18551,6 +19273,16 @@ "has-tostringtag": "^1.0.0" } }, + "why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "requires": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + } + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/client/package.json b/client/package.json index 3a555fccc..c10ef40bd 100644 --- a/client/package.json +++ b/client/package.json @@ -16,7 +16,9 @@ "lint": "eslint src --ext .tsx,.ts", "sass-lint": "stylelint ./src/**/*.scss", "build-internal": "tsc && vite build", - "build": "run-s lint sass-lint build-internal" + "build-test": "vitest run", + "build": "run-s lint sass-lint build-test build-internal", + "test": "vitest" }, "dependencies": { "@d3fc/d3fc-axis": "^3.0.6", @@ -94,7 +96,8 @@ "vite": "^4.5.0", "vite-aliases": "^0.11.3", "vite-plugin-node-polyfills": "^0.16.0", - "vite-plugin-svgr": "^4.2.0" + "vite-plugin-svgr": "^4.2.0", + "vitest": "^0.34.6" }, "engines": { "node": ">=16 <=16.20.2" diff --git a/client/src/app/routes/stardust/landing/ShimmerClaimedUtils.spec.ts b/client/src/app/routes/stardust/landing/ShimmerClaimedUtils.spec.ts index f48405a68..106a47161 100644 --- a/client/src/app/routes/stardust/landing/ShimmerClaimedUtils.spec.ts +++ b/client/src/app/routes/stardust/landing/ShimmerClaimedUtils.spec.ts @@ -10,166 +10,164 @@ const TOKEN_INFO: INodeInfoBaseToken = { useMetricPrefix: false }; -describe("build shimmer stats", () => { - it("should display percent", () => { - let [claimed, percent] = buildShimmerClaimedStats("1", "100", TOKEN_INFO); - expect(claimed).toBe("1 glow"); - expect(percent).toBe("1%"); - - [claimed, percent] = buildShimmerClaimedStats("5", "100", TOKEN_INFO); - expect(claimed).toBe("5 glow"); - expect(percent).toBe("5%"); - - [claimed, percent] = buildShimmerClaimedStats("1450896407249092", "1450896407249092", TOKEN_INFO); - expect(claimed).toBe("1,450,896,407 SMR"); - expect(percent).toBe("100%"); - }); - - it("should display <0.01% on small fractions", () => { - let [claimed, percent] = buildShimmerClaimedStats("1", "10009", TOKEN_INFO); - expect(claimed).toBe("1 glow"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("5123123", "1450896407249092", TOKEN_INFO); - expect(claimed).toBe("5.12 SMR"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("1", "10000", TOKEN_INFO); - expect(claimed).toBe("1 glow"); - expect(percent).toBe("0.01%"); - }); - - it("should display in glow for values <1000 glow", () => { - let [claimed, percent] = buildShimmerClaimedStats("999", "1450896407", TOKEN_INFO); - expect(claimed).toBe("999 glow"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("1000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("0.001 SMR"); - expect(percent).toBe("<0.01%"); - }); - - it("should show to three decimals for values 1000 glow < x < 1 SMR", () => { - let [claimed, percent] = buildShimmerClaimedStats("9999", "1450896407", TOKEN_INFO); - expect(claimed).toBe("0.009 SMR"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("999999", "1450896407", TOKEN_INFO); - expect(claimed).toBe("0.999 SMR"); - expect(percent).toBe("0.06%"); - - [claimed, percent] = buildShimmerClaimedStats("990000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("0.99 SMR"); - expect(percent).toBe("0.06%"); - }); - - it("should show to two decimals for values 1 SMR < x < 100 SMR", () => { - let [claimed, percent] = buildShimmerClaimedStats("9999999", "1450896407", TOKEN_INFO); - expect(claimed).toBe("9.99 SMR"); - expect(percent).toBe("0.68%"); - - [claimed, percent] = buildShimmerClaimedStats("99899999", "1450896407", TOKEN_INFO); - expect(claimed).toBe("99.89 SMR"); - expect(percent).toBe("6.88%"); - - [claimed, percent] = buildShimmerClaimedStats("199899999", "1450896407", TOKEN_INFO); - expect(claimed).toBe("199 SMR"); - expect(percent).toBe("13.77%"); - }); - - it("should not display magnitudes, but SMR formatted with commas", () => { - let [claimed, percent] = buildShimmerClaimedStats("1234198475", "1450896407", TOKEN_INFO); - expect(claimed).toBe("1,234 SMR"); - expect(percent).toBe("85.06%"); - - [claimed, percent] = buildShimmerClaimedStats("1234198475000", "10000000000000", TOKEN_INFO); - expect(claimed).toBe("1,234,198 SMR"); - expect(percent).toBe("12.34%"); - - [claimed, percent] = buildShimmerClaimedStats("1234198475000000", "2000000000000000", TOKEN_INFO); - expect(claimed).toBe("1,234,198,475 SMR"); - expect(percent).toBe("61.7%"); - - [claimed, percent] = buildShimmerClaimedStats( - "1234198475000000000", - "2000000000000000000", - TOKEN_INFO - ); - expect(claimed).toBe("1,234,198,475,000 SMR"); - expect(percent).toBe("61.7%"); - - [claimed, percent] = buildShimmerClaimedStats( - "1276198475000000000000", - "2000000000000000000000", - TOKEN_INFO - ); - expect(claimed).toBe("1,276,198,475,000,000 SMR"); - expect(percent).toBe("63.8%"); - - [claimed, percent] = buildShimmerClaimedStats( - "1234198475000000000000000", - "2000000000000000000000000", - TOKEN_INFO - ); - expect(claimed).toBe("1,234,198,475,000,000,000 SMR"); - expect(percent).toBe("61.7%"); - }); - - it("should display shimmer launch", () => { - let [claimed, percent] = buildShimmerClaimedStats("1", "1450896407", TOKEN_INFO); - expect(claimed).toBe("1 glow"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("10", "1450896407", TOKEN_INFO); - expect(claimed).toBe("10 glow"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("100", "1450896407", TOKEN_INFO); - expect(claimed).toBe("100 glow"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("1000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("0.001 SMR"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("13000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("0.013 SMR"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("100000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("0.1 SMR"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("123000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("0.123 SMR"); - expect(percent).toBe("<0.01%"); - - [claimed, percent] = buildShimmerClaimedStats("1000000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("1 SMR"); - expect(percent).toBe("0.06%"); - - [claimed, percent] = buildShimmerClaimedStats("1230000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("1.23 SMR"); - expect(percent).toBe("0.08%"); - - [claimed, percent] = buildShimmerClaimedStats("10000000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("10 SMR"); - expect(percent).toBe("0.68%"); - - [claimed, percent] = buildShimmerClaimedStats("12346000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("12.34 SMR"); - expect(percent).toBe("0.85%"); - - [claimed, percent] = buildShimmerClaimedStats("100999000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("100 SMR"); - expect(percent).toBe("6.96%"); - - [claimed, percent] = buildShimmerClaimedStats("1234000000", "1450896407", TOKEN_INFO); - expect(claimed).toBe("1,234 SMR"); - expect(percent).toBe("85.05%"); - - [claimed, percent] = buildShimmerClaimedStats("1450896407", "1450896407", TOKEN_INFO); - expect(claimed).toBe("1,450 SMR"); - expect(percent).toBe("100%"); - }); +test("buildShimmerClaimedStats should display percent", () => { + let [claimed, percent] = buildShimmerClaimedStats("1", "100", TOKEN_INFO); + expect(claimed).toBe("1 glow"); + expect(percent).toBe("1%"); + + [claimed, percent] = buildShimmerClaimedStats("5", "100", TOKEN_INFO); + expect(claimed).toBe("5 glow"); + expect(percent).toBe("5%"); + + [claimed, percent] = buildShimmerClaimedStats("1450896407249092", "1450896407249092", TOKEN_INFO); + expect(claimed).toBe("1,450,896,407 SMR"); + expect(percent).toBe("100%"); +}); + +test("buildShimmerClaimedStats should display <0.01% on small fractions", () => { + let [claimed, percent] = buildShimmerClaimedStats("1", "10009", TOKEN_INFO); + expect(claimed).toBe("1 glow"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("5123123", "1450896407249092", TOKEN_INFO); + expect(claimed).toBe("5.12 SMR"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("1", "10000", TOKEN_INFO); + expect(claimed).toBe("1 glow"); + expect(percent).toBe("0.01%"); +}); + +test("buildShimmerClaimedStats should display in glow for values <1000 glow", () => { + let [claimed, percent] = buildShimmerClaimedStats("999", "1450896407", TOKEN_INFO); + expect(claimed).toBe("999 glow"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("1000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("0.001 SMR"); + expect(percent).toBe("<0.01%"); +}); + +test("buildShimmerClaimedStats should show to three decimals for values 1000 glow < x < 1 SMR", () => { + let [claimed, percent] = buildShimmerClaimedStats("9999", "1450896407", TOKEN_INFO); + expect(claimed).toBe("0.009 SMR"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("999999", "1450896407", TOKEN_INFO); + expect(claimed).toBe("0.999 SMR"); + expect(percent).toBe("0.06%"); + + [claimed, percent] = buildShimmerClaimedStats("990000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("0.99 SMR"); + expect(percent).toBe("0.06%"); +}); + +test("buildShimmerClaimedStats should show to two decimals for values 1 SMR < x < 100 SMR", () => { + let [claimed, percent] = buildShimmerClaimedStats("9999999", "1450896407", TOKEN_INFO); + expect(claimed).toBe("9.99 SMR"); + expect(percent).toBe("0.68%"); + + [claimed, percent] = buildShimmerClaimedStats("99899999", "1450896407", TOKEN_INFO); + expect(claimed).toBe("99.89 SMR"); + expect(percent).toBe("6.88%"); + + [claimed, percent] = buildShimmerClaimedStats("199899999", "1450896407", TOKEN_INFO); + expect(claimed).toBe("199 SMR"); + expect(percent).toBe("13.77%"); +}); + +test("buildShimmerClaimedStats should not display magnitudes, but SMR formatted with commas", () => { + let [claimed, percent] = buildShimmerClaimedStats("1234198475", "1450896407", TOKEN_INFO); + expect(claimed).toBe("1,234 SMR"); + expect(percent).toBe("85.06%"); + + [claimed, percent] = buildShimmerClaimedStats("1234198475000", "10000000000000", TOKEN_INFO); + expect(claimed).toBe("1,234,198 SMR"); + expect(percent).toBe("12.34%"); + + [claimed, percent] = buildShimmerClaimedStats("1234198475000000", "2000000000000000", TOKEN_INFO); + expect(claimed).toBe("1,234,198,475 SMR"); + expect(percent).toBe("61.7%"); + + [claimed, percent] = buildShimmerClaimedStats( + "1234198475000000000", + "2000000000000000000", + TOKEN_INFO + ); + expect(claimed).toBe("1,234,198,475,000 SMR"); + expect(percent).toBe("61.7%"); + + [claimed, percent] = buildShimmerClaimedStats( + "1276198475000000000000", + "2000000000000000000000", + TOKEN_INFO + ); + expect(claimed).toBe("1,276,198,475,000,000 SMR"); + expect(percent).toBe("63.8%"); + + [claimed, percent] = buildShimmerClaimedStats( + "1234198475000000000000000", + "2000000000000000000000000", + TOKEN_INFO + ); + expect(claimed).toBe("1,234,198,475,000,000,000 SMR"); + expect(percent).toBe("61.7%"); +}); + +test("buildShimmerClaimedStats should display shimmer launch", () => { + let [claimed, percent] = buildShimmerClaimedStats("1", "1450896407", TOKEN_INFO); + expect(claimed).toBe("1 glow"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("10", "1450896407", TOKEN_INFO); + expect(claimed).toBe("10 glow"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("100", "1450896407", TOKEN_INFO); + expect(claimed).toBe("100 glow"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("1000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("0.001 SMR"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("13000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("0.013 SMR"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("100000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("0.1 SMR"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("123000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("0.123 SMR"); + expect(percent).toBe("<0.01%"); + + [claimed, percent] = buildShimmerClaimedStats("1000000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("1 SMR"); + expect(percent).toBe("0.06%"); + + [claimed, percent] = buildShimmerClaimedStats("1230000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("1.23 SMR"); + expect(percent).toBe("0.08%"); + + [claimed, percent] = buildShimmerClaimedStats("10000000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("10 SMR"); + expect(percent).toBe("0.68%"); + + [claimed, percent] = buildShimmerClaimedStats("12346000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("12.34 SMR"); + expect(percent).toBe("0.85%"); + + [claimed, percent] = buildShimmerClaimedStats("100999000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("100 SMR"); + expect(percent).toBe("6.96%"); + + [claimed, percent] = buildShimmerClaimedStats("1234000000", "1450896407", TOKEN_INFO); + expect(claimed).toBe("1,234 SMR"); + expect(percent).toBe("85.05%"); + + [claimed, percent] = buildShimmerClaimedStats("1450896407", "1450896407", TOKEN_INFO); + expect(claimed).toBe("1,450 SMR"); + expect(percent).toBe("100%"); }); diff --git a/client/src/helpers/bigDecimal.spec.ts b/client/src/helpers/bigDecimal.spec.ts index 2e32e9d50..e80d27fb1 100644 --- a/client/src/helpers/bigDecimal.spec.ts +++ b/client/src/helpers/bigDecimal.spec.ts @@ -1,93 +1,91 @@ import BigDecimal from "./bigDecimal"; -describe("BigDecimal", () => { - it("should construct with whole", () => { - expect(new BigDecimal("0").toString()).toBe("0"); - expect(new BigDecimal("999").toString()).toBe("999"); - }); - - it("should construct with decimal", () => { - expect(new BigDecimal("0.12345").toString()).toBe("0.12"); - }); - - it("should construct from big int", () => { - expect(BigDecimal.fromBigInt(BigInt("11234")).toString()).toBe("11234"); - expect(BigDecimal.fromBigInt(BigInt(11234)).toString()).toBe("11234"); - expect(BigDecimal.fromBigInt(BigInt(BigInt(11234))).toString()).toBe("11234"); - expect(BigDecimal.fromBigInt(BigInt(true)).toString()).toBe("1"); - expect(BigDecimal.fromBigInt(BigInt(false)).toString()).toBe("0"); - // with fraction - expect(BigDecimal.fromBigInt(BigInt("112301"), 4).toString()).toBe("11.2301"); - }); - - it("should round properly", () => { - expect(new BigDecimal("12345", 10, true).toString()).toBe("12345"); - expect(new BigDecimal("12345", 10, false).toString()).toBe("12345"); - expect(new BigDecimal("12345.12345678", 4, false).toString()).toBe("12345.1234"); - expect(new BigDecimal("12345.12344678", 4, true).toString()).toBe("12345.1234"); - expect(new BigDecimal("12345.12345678", 4, true).toString()).toBe("12345.1235"); - expect(new BigDecimal("12345.12345678", 2, true).toString()).toBe("12345.12"); - expect(new BigDecimal("12345.12345678", 2, false).toString()).toBe("12345.12"); - expect(new BigDecimal("12345.12545678", 2, true).toString()).toBe("12345.13"); - expect(new BigDecimal("12345.12545678", 2, false).toString()).toBe("12345.12"); - }); - - it("should perform addition", () => { - let from = new BigDecimal("1.12645"); - let res = from.add("100999"); - expect(res.toString()).toBe("101000.12"); - - from = new BigDecimal("999000"); - res = from.add("1000"); - expect(res.toString()).toBe("1000000"); - expect(res.add("5.123456").toString()).toBe("1000005.12"); - - // rounded = true - from = new BigDecimal("1.12645", 2, true); - res = from.add("100999"); - expect(res.toString()).toBe("101000.13"); - }); - - it("should perform subtraction", () => { - let from = new BigDecimal("1.12567"); - let res = from.subtract("100999"); - expect(res.toString()).toBe("-100997.88"); - - from = new BigDecimal("999000"); - res = from.subtract("1000"); - expect(res.toString()).toBe("998000"); - expect(res.subtract("5.12789").toString()).toBe("997994.88"); - - // rounded = true - from = new BigDecimal("1.12567", 2, true); - res = from.subtract("100999"); - expect(res.toString()).toBe("-100997.87"); - }); - - it("should perform multiplication", () => { - let from = new BigDecimal("1000123321"); - const res = from.multiply("20000"); - expect(res.toString()).toBe("20002466420000"); - - from = new BigDecimal("10.49582"); - expect(from.multiply("5.928371").toString()).toBe("62.1"); - - from = new BigDecimal("10.49582"); - expect(from.multiply("-5.928371").toString()).toBe("-62.1"); - - // rounded = true - from = new BigDecimal("10.49582", 2, true); - expect(from.multiply("5.928371").toString()).toBe("62.27"); - }); - - it("should perform division", () => { - let from = new BigDecimal("1000123321"); - const res = from.divide("20000"); - - expect(res.toString()).toBe("50006.16"); - - from = new BigDecimal("10.49582"); - expect(from.divide("5.928371").toString()).toBe("1.77"); - expect(from.divide("5.924371").toString()).toBe("1.77"); - }); +test("BigDecimal should construct with whole", () => { + expect(new BigDecimal("0").toString()).toBe("0"); + expect(new BigDecimal("999").toString()).toBe("999"); +}); + +test("BigDecimal should construct with decimal", () => { + expect(new BigDecimal("0.12345").toString()).toBe("0.12"); +}); + +test("BigDecimal should construct from big int", () => { + expect(BigDecimal.fromBigInt(BigInt("11234")).toString()).toBe("11234"); + expect(BigDecimal.fromBigInt(BigInt(11234)).toString()).toBe("11234"); + expect(BigDecimal.fromBigInt(BigInt(BigInt(11234))).toString()).toBe("11234"); + expect(BigDecimal.fromBigInt(BigInt(true)).toString()).toBe("1"); + expect(BigDecimal.fromBigInt(BigInt(false)).toString()).toBe("0"); + // with fraction + expect(BigDecimal.fromBigInt(BigInt("112301"), 4).toString()).toBe("11.2301"); +}); + +test("BigDecimal should round properly", () => { + expect(new BigDecimal("12345", 10, true).toString()).toBe("12345"); + expect(new BigDecimal("12345", 10, false).toString()).toBe("12345"); + expect(new BigDecimal("12345.12345678", 4, false).toString()).toBe("12345.1234"); + expect(new BigDecimal("12345.12344678", 4, true).toString()).toBe("12345.1234"); + expect(new BigDecimal("12345.12345678", 4, true).toString()).toBe("12345.1235"); + expect(new BigDecimal("12345.12345678", 2, true).toString()).toBe("12345.12"); + expect(new BigDecimal("12345.12345678", 2, false).toString()).toBe("12345.12"); + expect(new BigDecimal("12345.12545678", 2, true).toString()).toBe("12345.13"); + expect(new BigDecimal("12345.12545678", 2, false).toString()).toBe("12345.12"); +}); + +test("BigDecimal should perform addition", () => { + let from = new BigDecimal("1.12645"); + let res = from.add("100999"); + expect(res.toString()).toBe("101000.12"); + + from = new BigDecimal("999000"); + res = from.add("1000"); + expect(res.toString()).toBe("1000000"); + expect(res.add("5.123456").toString()).toBe("1000005.12"); + + // rounded = true + from = new BigDecimal("1.12645", 2, true); + res = from.add("100999"); + expect(res.toString()).toBe("101000.13"); +}); + +test("BigDecimal should perform subtraction", () => { + let from = new BigDecimal("1.12567"); + let res = from.subtract("100999"); + expect(res.toString()).toBe("-100997.88"); + + from = new BigDecimal("999000"); + res = from.subtract("1000"); + expect(res.toString()).toBe("998000"); + expect(res.subtract("5.12789").toString()).toBe("997994.88"); + + // rounded = true + from = new BigDecimal("1.12567", 2, true); + res = from.subtract("100999"); + expect(res.toString()).toBe("-100997.87"); +}); + +test("BigDecimal should perform multiplication", () => { + let from = new BigDecimal("1000123321"); + const res = from.multiply("20000"); + expect(res.toString()).toBe("20002466420000"); + + from = new BigDecimal("10.49582"); + expect(from.multiply("5.928371").toString()).toBe("62.1"); + + from = new BigDecimal("10.49582"); + expect(from.multiply("-5.928371").toString()).toBe("-62.1"); + + // rounded = true + from = new BigDecimal("10.49582", 2, true); + expect(from.multiply("5.928371").toString()).toBe("62.27"); +}); + +test("BigDecimal should perform division", () => { + let from = new BigDecimal("1000123321"); + const res = from.divide("20000"); + + expect(res.toString()).toBe("50006.16"); + + from = new BigDecimal("10.49582"); + expect(from.divide("5.928371").toString()).toBe("1.77"); + expect(from.divide("5.924371").toString()).toBe("1.77"); }); diff --git a/client/src/helpers/stardust/convertToBigEndian.spec.ts b/client/src/helpers/stardust/convertToBigEndian.spec.ts index f704277e5..eb9c2ed41 100644 --- a/client/src/helpers/stardust/convertToBigEndian.spec.ts +++ b/client/src/helpers/stardust/convertToBigEndian.spec.ts @@ -1,23 +1,21 @@ import { Converter } from "./convertUtils"; -describe("convertToBigEndian", () => { - it("should convert little endian encoded hex to big endian", () => { - const outputIndex = "0200"; - expect(Converter.convertToBigEndian(outputIndex)).toBe("0002"); - }); +test("convertToBigEndian should convert little endian encoded hex to big endian", () => { + const outputIndex = "0200"; + expect(Converter.convertToBigEndian(outputIndex)).toBe("0002"); +}); - it("should convert to big endian when the index length is 6", () => { - const outputIndex = "9F8601"; - expect(Converter.convertToBigEndian(outputIndex)).toBe("01869F"); - }); +test("convertToBigEndian should convert to big endian when the index length is 6", () => { + const outputIndex = "9F8601"; + expect(Converter.convertToBigEndian(outputIndex)).toBe("01869F"); +}); - it("should convert to big endian when the index length is 8", () => { - const outputIndex = "9F860101"; - expect(Converter.convertToBigEndian(outputIndex)).toBe("0101869F"); - }); +test("convertToBigEndian should convert to big endian when the index length is 8", () => { + const outputIndex = "9F860101"; + expect(Converter.convertToBigEndian(outputIndex)).toBe("0101869F"); +}); - it("should convert to big endian if the index has odd length", () => { - const outputIndex = "9F86010"; - expect(Converter.convertToBigEndian(outputIndex)).toBe("1060F809"); - }); +test("convertToBigEndian should convert to big endian if the index has odd length", () => { + const outputIndex = "9F86010"; + expect(Converter.convertToBigEndian(outputIndex)).toBe("1060F809"); }); diff --git a/client/src/helpers/stardust/valueFormatHelper.spec.ts b/client/src/helpers/stardust/valueFormatHelper.spec.ts index f8f7ab2d0..bc8fd0a7f 100644 --- a/client/src/helpers/stardust/valueFormatHelper.spec.ts +++ b/client/src/helpers/stardust/valueFormatHelper.spec.ts @@ -9,57 +9,55 @@ const tokenInfo = { "useMetricPrefix": false }; -describe("formatAmount", () => { - it("should format 1 subunit properly", () => { - expect(formatAmount(1, tokenInfo)).toBe("0.000001 IOTA"); - }); +test("formatAmount should format 1 subunit properly", () => { + expect(formatAmount(1, tokenInfo)).toBe("0.000001 IOTA"); +}); - it("should format 10 subunit properly", () => { - expect(formatAmount(10, tokenInfo)).toBe("0.00001 IOTA"); - }); +test("formatAmount should format 10 subunit properly", () => { + expect(formatAmount(10, tokenInfo)).toBe("0.00001 IOTA"); +}); - it("should format 100 subunit properly", () => { - expect(formatAmount(100, tokenInfo)).toBe("0.0001 IOTA"); - }); +test("formatAmount should format 100 subunit properly", () => { + expect(formatAmount(100, tokenInfo)).toBe("0.0001 IOTA"); +}); - it("should format 1000 subunit properly", () => { - expect(formatAmount(1000, tokenInfo)).toBe("0.001 IOTA"); - }); +test("formatAmount should format 1000 subunit properly", () => { + expect(formatAmount(1000, tokenInfo)).toBe("0.001 IOTA"); +}); - it("should format 10000 subunit properly", () => { - expect(formatAmount(10000, tokenInfo)).toBe("0.01 IOTA"); - }); +test("formatAmount should format 10000 subunit properly", () => { + expect(formatAmount(10000, tokenInfo)).toBe("0.01 IOTA"); +}); - it("should format 100000 subunit properly", () => { - expect(formatAmount(100000, tokenInfo)).toBe("0.1 IOTA"); - }); +test("formatAmount should format 100000 subunit properly", () => { + expect(formatAmount(100000, tokenInfo)).toBe("0.1 IOTA"); +}); - it("should format 1 unit properly", () => { - expect(formatAmount(1000000, tokenInfo)).toBe("1 IOTA"); - }); +test("formatAmount should format 1 unit properly", () => { + expect(formatAmount(1000000, tokenInfo)).toBe("1 IOTA"); +}); - it("should format 1 unit with fraction properly", () => { - expect(formatAmount(1234567, tokenInfo)).toBe("1.23 IOTA"); - }); +test("formatAmount should format 1 unit with fraction properly", () => { + expect(formatAmount(1234567, tokenInfo)).toBe("1.23 IOTA"); +}); - it("should handle edge case from issue 'explorer/issues/822'", () => { - expect(formatAmount(1140000, tokenInfo)).toBe("1.14 IOTA"); - }); +test("formatAmount should handle edge case from issue 'explorer/issues/822'", () => { + expect(formatAmount(1140000, tokenInfo)).toBe("1.14 IOTA"); +}); - it("should honour precision 3", () => { - expect(formatAmount(9999, tokenInfo, false, 3)).toBe("0.009 IOTA"); - }); +test("formatAmount should honour precision 3", () => { + expect(formatAmount(9999, tokenInfo, false, 3)).toBe("0.009 IOTA"); +}); - it("should honour precision 4", () => { - expect(formatAmount(9999, tokenInfo, false, 4)).toBe("0.0099 IOTA"); - }); +test("formatAmount should honour precision 4", () => { + expect(formatAmount(9999, tokenInfo, false, 4)).toBe("0.0099 IOTA"); +}); - it("should honour precision 0", () => { - expect(formatAmount(1450896407249092, tokenInfo, false, 0)).toBe("1450896407 IOTA"); - }); +test("formatAmount should honour precision 0", () => { + expect(formatAmount(1450896407249092, tokenInfo, false, 0)).toBe("1450896407 IOTA"); +}); - it("should format big values properly", () => { - expect(formatAmount(1450896407249092, tokenInfo)).toBe("1450896407.24 IOTA"); - }); +test("formatAmount should format big values properly", () => { + expect(formatAmount(1450896407249092, tokenInfo)).toBe("1450896407.24 IOTA"); }); diff --git a/client/vite.config.ts b/client/vite.config.ts index dc1862681..ab31aace8 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -23,6 +23,10 @@ export default defineConfig(() => { }), nodePolyfills() ], + test: { + globals: true, + teardownTimeout: 100 + }, }; });