diff --git a/packages/dashboard/package.json b/packages/dashboard/package.json index e8cb03d9..bbed12a4 100644 --- a/packages/dashboard/package.json +++ b/packages/dashboard/package.json @@ -60,8 +60,10 @@ "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-next": "12.1.4", "eslint-plugin-import": "^2.25.3", + "jest": "^28.1.0", "postcss": "^8.4.12", "tailwindcss": "^3.0.23", + "ts-jest": "^28.0.2", "typescript": "4.6.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 430f4996..ed4fa884 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,6 +50,7 @@ importers: graphql: ^15.8.0 graphql-tag: ^2.12.6 immer: ^9.0.12 + jest: ^28.1.0 js-cookie: ^3.0.1 next: 12.1.6 postcss: ^8.4.12 @@ -65,6 +66,7 @@ importers: swr: ^1.3.0 systeminformation: ^5.11.9 tailwindcss: ^3.0.23 + ts-jest: ^28.0.2 tslib: ^2.4.0 typescript: 4.6.4 validator: ^13.7.0 @@ -117,8 +119,10 @@ importers: eslint-config-airbnb-typescript: 17.0.0_r46exuh3jlhq2wmrnqx2ufqspa eslint-config-next: 12.1.4_e6a2zi6fqdwfehht5cxvkmo3zu eslint-plugin-import: 2.26.0_hhyjdrupy4c2vgtpytri6cjwoy + jest: 28.1.0_@types+node@17.0.31 postcss: 8.4.13 tailwindcss: 3.0.24 + ts-jest: 28.0.2_ps5qfvt5fosg52obpfzuxthwve typescript: 4.6.4 packages/system-api: @@ -749,7 +753,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-syntax-bigint/7.8.3_@babel+core@7.17.10: @@ -758,7 +762,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.17.10: @@ -786,7 +790,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.17.10: @@ -795,7 +799,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-syntax-jsx/7.16.7_@babel+core@7.17.10: @@ -823,7 +827,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.17.10: @@ -832,7 +836,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.17.10: @@ -841,7 +845,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.17.10: @@ -859,7 +863,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.17.10: @@ -868,7 +872,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.17.10: @@ -878,7 +882,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-syntax-typescript/7.17.10_@babel+core@7.17.10: @@ -888,7 +892,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.10 - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 dev: true /@babel/plugin-transform-arrow-functions/7.17.12_@babel+core@7.17.10: @@ -2868,6 +2872,49 @@ packages: slash: 3.0.0 dev: true + /@jest/core/28.1.0: + resolution: {integrity: sha512-/2PTt0ywhjZ4NwNO4bUqD9IVJfmFVhVKGlhvSpmEfUCuxYf/3NHcKmRFI+I71lYzbTT3wMuYpETDCTHo81gC/g==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/console': 28.1.0 + '@jest/reporters': 28.1.0 + '@jest/test-result': 28.1.0 + '@jest/transform': 28.1.0 + '@jest/types': 28.1.0 + '@types/node': 17.0.31 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.3.0 + exit: 0.1.2 + graceful-fs: 4.2.10 + jest-changed-files: 28.0.2 + jest-config: 28.1.0_@types+node@17.0.31 + jest-haste-map: 28.1.0 + jest-message-util: 28.1.0 + jest-regex-util: 28.0.2 + jest-resolve: 28.1.0 + jest-resolve-dependencies: 28.1.0 + jest-runner: 28.1.0 + jest-runtime: 28.1.0 + jest-snapshot: 28.1.0 + jest-util: 28.1.0 + jest-validate: 28.1.0 + jest-watcher: 28.1.0 + micromatch: 4.0.5 + pretty-format: 28.1.0 + rimraf: 3.0.2 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /@jest/core/28.1.0_ts-node@10.8.2: resolution: {integrity: sha512-/2PTt0ywhjZ4NwNO4bUqD9IVJfmFVhVKGlhvSpmEfUCuxYf/3NHcKmRFI+I71lYzbTT3wMuYpETDCTHo81gC/g==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -2980,7 +3027,7 @@ packages: chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 - glob: 7.2.0 + glob: 7.2.3 graceful-fs: 4.2.10 istanbul-lib-coverage: 3.2.0 istanbul-lib-instrument: 5.2.0 @@ -3596,8 +3643,8 @@ packages: /@types/babel__core/7.1.19: resolution: {integrity: sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==} dependencies: - '@babel/parser': 7.17.10 - '@babel/types': 7.17.10 + '@babel/parser': 7.18.5 + '@babel/types': 7.18.4 '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 '@types/babel__traverse': 7.17.1 @@ -3606,20 +3653,20 @@ packages: /@types/babel__generator/7.6.4: resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} dependencies: - '@babel/types': 7.17.10 + '@babel/types': 7.18.4 dev: true /@types/babel__template/7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: - '@babel/parser': 7.17.10 - '@babel/types': 7.17.10 + '@babel/parser': 7.18.5 + '@babel/types': 7.18.4 dev: true /@types/babel__traverse/7.17.1: resolution: {integrity: sha512-kVzjari1s2YVi77D3w1yuvohV2idweYXMCDzqBiVNN63TcDWrIlTVOYpqVrvbbyOE/IyzBoTKF0fdnLPEORFxA==} dependencies: - '@babel/types': 7.17.10 + '@babel/types': 7.18.4 dev: true /@types/body-parser/1.19.2: @@ -4770,7 +4817,7 @@ packages: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} dependencies: - '@babel/helper-plugin-utils': 7.16.7 + '@babel/helper-plugin-utils': 7.17.12 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.0 @@ -4784,7 +4831,7 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} dependencies: '@babel/template': 7.16.7 - '@babel/types': 7.17.10 + '@babel/types': 7.18.4 '@types/babel__core': 7.1.19 '@types/babel__traverse': 7.17.1 dev: true @@ -5315,7 +5362,7 @@ packages: dev: false /co/4.6.0: - resolution: {integrity: sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=} + resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} dev: true @@ -6734,7 +6781,7 @@ packages: strip-final-newline: 2.0.0 /exit/0.1.2: - resolution: {integrity: sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=} + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} dev: true @@ -7278,7 +7325,6 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 - dev: true /global-dirs/0.1.1: resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} @@ -8117,7 +8163,7 @@ packages: engines: {node: '>=8'} dependencies: '@babel/core': 7.17.10 - '@babel/parser': 7.17.10 + '@babel/parser': 7.18.5 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 6.3.0 @@ -8192,6 +8238,34 @@ packages: - supports-color dev: true + /jest-cli/28.1.0_@types+node@17.0.31: + resolution: {integrity: sha512-fDJRt6WPRriHrBsvvgb93OxgajHHsJbk4jZxiPqmZbMDRcHskfJBBfTyjFko0jjfprP544hOktdSi9HVgl4VUQ==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 28.1.0 + '@jest/test-result': 28.1.0 + '@jest/types': 28.1.0 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.10 + import-local: 3.1.0 + jest-config: 28.1.0_@types+node@17.0.31 + jest-util: 28.1.0 + jest-validate: 28.1.0 + prompts: 2.4.2 + yargs: 17.4.1 + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + /jest-cli/28.1.0_qxft4nzwxz7jey57xog52j3doy: resolution: {integrity: sha512-fDJRt6WPRriHrBsvvgb93OxgajHHsJbk4jZxiPqmZbMDRcHskfJBBfTyjFko0jjfprP544hOktdSi9HVgl4VUQ==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -8220,6 +8294,45 @@ packages: - ts-node dev: true + /jest-config/28.1.0_@types+node@17.0.31: + resolution: {integrity: sha512-aOV80E9LeWrmflp7hfZNn/zGA4QKv/xsn2w8QCBP0t0+YqObuCWTSgNbHJ0j9YsTuCO08ZR/wsvlxqqHX20iUA==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.17.10 + '@jest/test-sequencer': 28.1.0 + '@jest/types': 28.1.0 + '@types/node': 17.0.31 + babel-jest: 28.1.0_@babel+core@7.17.10 + chalk: 4.1.2 + ci-info: 3.3.0 + deepmerge: 4.2.2 + glob: 7.2.3 + graceful-fs: 4.2.10 + jest-circus: 28.1.0 + jest-environment-node: 28.1.0 + jest-get-type: 28.0.2 + jest-regex-util: 28.0.2 + jest-resolve: 28.1.0 + jest-runner: 28.1.0 + jest-util: 28.1.0 + jest-validate: 28.1.0 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 28.1.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + /jest-config/28.1.0_qxft4nzwxz7jey57xog52j3doy: resolution: {integrity: sha512-aOV80E9LeWrmflp7hfZNn/zGA4QKv/xsn2w8QCBP0t0+YqObuCWTSgNbHJ0j9YsTuCO08ZR/wsvlxqqHX20iUA==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -8476,7 +8589,7 @@ packages: cjs-module-lexer: 1.2.2 collect-v8-coverage: 1.0.1 execa: 5.1.1 - glob: 7.2.0 + glob: 7.2.3 graceful-fs: 4.2.10 jest-haste-map: 28.1.0 jest-message-util: 28.1.0 @@ -8496,10 +8609,10 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} dependencies: '@babel/core': 7.17.10 - '@babel/generator': 7.17.10 + '@babel/generator': 7.18.2 '@babel/plugin-syntax-typescript': 7.17.10_@babel+core@7.17.10 - '@babel/traverse': 7.17.10 - '@babel/types': 7.17.10 + '@babel/traverse': 7.18.5 + '@babel/types': 7.18.4 '@jest/expect-utils': 28.1.0 '@jest/transform': 28.1.0 '@jest/types': 28.1.0 @@ -8569,6 +8682,25 @@ packages: supports-color: 8.1.1 dev: true + /jest/28.1.0_@types+node@17.0.31: + resolution: {integrity: sha512-TZR+tHxopPhzw3c3560IJXZWLNHgpcz1Zh0w5A65vynLGNcg/5pZ+VildAd7+XGOu6jd58XMY/HNn0IkZIXVXg==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 28.1.0 + import-local: 3.1.0 + jest-cli: 28.1.0_@types+node@17.0.31 + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + /jest/28.1.0_qxft4nzwxz7jey57xog52j3doy: resolution: {integrity: sha512-TZR+tHxopPhzw3c3560IJXZWLNHgpcz1Zh0w5A65vynLGNcg/5pZ+VildAd7+XGOu6jd58XMY/HNn0IkZIXVXg==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} @@ -8903,7 +9035,7 @@ packages: dev: true /lodash.memoize/4.1.2: - resolution: {integrity: sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=} + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} dev: true /lodash.merge/4.6.2: @@ -11106,7 +11238,7 @@ packages: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} hasBin: true dependencies: - glob: 7.2.0 + glob: 7.2.3 /run-async/2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} @@ -11393,7 +11525,7 @@ packages: dev: true /sprintf-js/1.0.3: - resolution: {integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=} + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true /stack-trace/0.0.10: @@ -11721,7 +11853,7 @@ packages: engines: {node: '>=8'} dependencies: '@istanbuljs/schema': 0.1.3 - glob: 7.2.0 + glob: 7.2.3 minimatch: 3.1.2 dev: true @@ -11846,6 +11978,40 @@ packages: tslib: 2.4.0 dev: false + /ts-jest/28.0.2_ps5qfvt5fosg52obpfzuxthwve: + resolution: {integrity: sha512-IOZMb3D0gx6IHO9ywPgiQxJ3Zl4ECylEFwoVpENB55aTn5sdO0Ptyx/7noNBxAaUff708RqQL4XBNxxOVjY0vQ==} + engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@types/jest': ^27.0.0 + babel-jest: ^28.0.0 + esbuild: '*' + jest: ^28.0.0 + typescript: '>=4.3' + peerDependenciesMeta: + '@babel/core': + optional: true + '@types/jest': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@babel/core': 7.17.10 + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest: 28.1.0_@types+node@17.0.31 + jest-util: 28.1.0 + json5: 2.2.1 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.3.7 + typescript: 4.6.4 + yargs-parser: 20.2.9 + dev: true + /ts-jest/28.0.2_z3fx76c5ksuwr36so7o5uc2kcy: resolution: {integrity: sha512-IOZMb3D0gx6IHO9ywPgiQxJ3Zl4ECylEFwoVpENB55aTn5sdO0Ptyx/7noNBxAaUff708RqQL4XBNxxOVjY0vQ==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}