From 73266d69477a71410e1d6a9e406da748836c5728 Mon Sep 17 00:00:00 2001 From: forbesus Date: Thu, 7 Nov 2024 06:13:01 -0800 Subject: [PATCH] test(observability): cover logger service with unit tests ref #429 --- package-lock.json | 325 ++---------------- packages/logging/jest.config.js | 7 + packages/logging/package.json | 6 +- .../servicies/logger/logger.service.spec.ts | 122 +++++++ .../src/servicies/logger/logger.service.ts | 16 +- 5 files changed, 174 insertions(+), 302 deletions(-) create mode 100644 packages/logging/jest.config.js create mode 100644 packages/logging/src/servicies/logger/logger.service.spec.ts diff --git a/package-lock.json b/package-lock.json index 8150de74e..cde765763 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ }, "apps/api": { "name": "@akashnetwork/console-api", - "version": "2.28.0-beta.4", + "version": "2.28.0-beta.7", "license": "Apache-2.0", "dependencies": { "@akashnetwork/akash-api": "^1.3.0", @@ -224,7 +224,7 @@ }, "apps/deploy-web": { "name": "@akashnetwork/console-web", - "version": "2.21.0-beta.0", + "version": "2.21.0-beta.1", "license": "Apache-2.0", "dependencies": { "@akashnetwork/akash-api": "^1.3.0", @@ -1642,7 +1642,6 @@ }, "node_modules/@babel/plugin-syntax-bigint": { "version": "7.8.3", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" @@ -1756,7 +1755,6 @@ }, "node_modules/@babel/plugin-syntax-jsx": { "version": "7.24.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.24.7" @@ -1856,7 +1854,6 @@ }, "node_modules/@babel/plugin-syntax-typescript": { "version": "7.24.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.24.7" @@ -2881,7 +2878,6 @@ }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", - "dev": true, "license": "MIT" }, "node_modules/@casl/ability": { @@ -5615,7 +5611,6 @@ }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", - "dev": true, "license": "ISC", "dependencies": { "camelcase": "^5.3.1", @@ -5630,7 +5625,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { "version": "1.0.10", - "dev": true, "license": "MIT", "dependencies": { "sprintf-js": "~1.0.2" @@ -5638,7 +5632,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "locate-path": "^5.0.0", @@ -5650,7 +5643,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { "version": "3.14.1", - "dev": true, "license": "MIT", "dependencies": { "argparse": "^1.0.7", @@ -5662,7 +5654,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { "version": "5.0.0", - "dev": true, "license": "MIT", "dependencies": { "p-locate": "^4.1.0" @@ -5673,7 +5664,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { "version": "2.3.0", - "dev": true, "license": "MIT", "dependencies": { "p-try": "^2.0.0" @@ -5687,7 +5677,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "p-limit": "^2.2.0" @@ -5698,7 +5687,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { "version": "5.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -5706,7 +5694,6 @@ }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -5714,7 +5701,6 @@ }, "node_modules/@jest/console": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -5730,7 +5716,6 @@ }, "node_modules/@jest/console/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -5744,7 +5729,6 @@ }, "node_modules/@jest/console/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -5759,7 +5743,6 @@ }, "node_modules/@jest/console/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -5770,12 +5753,10 @@ }, "node_modules/@jest/console/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/@jest/console/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -5783,7 +5764,6 @@ }, "node_modules/@jest/console/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -5794,7 +5774,6 @@ }, "node_modules/@jest/core": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/console": "^29.7.0", @@ -5840,7 +5819,6 @@ }, "node_modules/@jest/core/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -5854,14 +5832,12 @@ }, "node_modules/@jest/core/node_modules/arg": { "version": "4.1.3", - "dev": true, "license": "MIT", "optional": true, "peer": true }, "node_modules/@jest/core/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -5870,7 +5846,6 @@ }, "node_modules/@jest/core/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -5885,7 +5860,6 @@ }, "node_modules/@jest/core/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -5896,12 +5870,10 @@ }, "node_modules/@jest/core/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/@jest/core/node_modules/glob": { "version": "7.2.3", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -5920,7 +5892,6 @@ }, "node_modules/@jest/core/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -5928,7 +5899,6 @@ }, "node_modules/@jest/core/node_modules/jest-config": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", @@ -5972,7 +5942,6 @@ }, "node_modules/@jest/core/node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -5983,7 +5952,6 @@ }, "node_modules/@jest/core/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -5994,7 +5962,6 @@ }, "node_modules/@jest/core/node_modules/ts-node": { "version": "10.9.2", - "dev": true, "license": "MIT", "optional": true, "peer": true, @@ -6038,7 +6005,6 @@ }, "node_modules/@jest/environment": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/fake-timers": "^29.7.0", @@ -6052,7 +6018,6 @@ }, "node_modules/@jest/expect": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "expect": "^29.7.0", @@ -6064,7 +6029,6 @@ }, "node_modules/@jest/expect-utils": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "jest-get-type": "^29.6.3" @@ -6075,7 +6039,6 @@ }, "node_modules/@jest/fake-timers": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -6091,7 +6054,6 @@ }, "node_modules/@jest/globals": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", @@ -6105,7 +6067,6 @@ }, "node_modules/@jest/reporters": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", @@ -6147,7 +6108,6 @@ }, "node_modules/@jest/reporters/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -6161,7 +6121,6 @@ }, "node_modules/@jest/reporters/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -6170,7 +6129,6 @@ }, "node_modules/@jest/reporters/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -6185,7 +6143,6 @@ }, "node_modules/@jest/reporters/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -6196,12 +6153,10 @@ }, "node_modules/@jest/reporters/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/@jest/reporters/node_modules/glob": { "version": "7.2.3", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -6220,7 +6175,6 @@ }, "node_modules/@jest/reporters/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -6228,7 +6182,6 @@ }, "node_modules/@jest/reporters/node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -6239,7 +6192,6 @@ }, "node_modules/@jest/reporters/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -6250,7 +6202,6 @@ }, "node_modules/@jest/schemas": { "version": "29.6.3", - "dev": true, "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.27.8" @@ -6261,7 +6212,6 @@ }, "node_modules/@jest/source-map": { "version": "29.6.3", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", @@ -6274,7 +6224,6 @@ }, "node_modules/@jest/test-result": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/console": "^29.7.0", @@ -6288,7 +6237,6 @@ }, "node_modules/@jest/test-sequencer": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/test-result": "^29.7.0", @@ -6302,7 +6250,6 @@ }, "node_modules/@jest/transform": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", @@ -6327,7 +6274,6 @@ }, "node_modules/@jest/transform/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -6341,7 +6287,6 @@ }, "node_modules/@jest/transform/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -6356,7 +6301,6 @@ }, "node_modules/@jest/transform/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -6367,17 +6311,14 @@ }, "node_modules/@jest/transform/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/@jest/transform/node_modules/convert-source-map": { "version": "2.0.0", - "dev": true, "license": "MIT" }, "node_modules/@jest/transform/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -6385,7 +6326,6 @@ }, "node_modules/@jest/transform/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -6396,7 +6336,6 @@ }, "node_modules/@jest/types": { "version": "29.6.3", - "dev": true, "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", @@ -6412,7 +6351,6 @@ }, "node_modules/@jest/types/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -6426,7 +6364,6 @@ }, "node_modules/@jest/types/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -6441,7 +6378,6 @@ }, "node_modules/@jest/types/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -6452,12 +6388,10 @@ }, "node_modules/@jest/types/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/@jest/types/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -6465,7 +6399,6 @@ }, "node_modules/@jest/types/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -13592,7 +13525,6 @@ }, "node_modules/@sinclair/typebox": { "version": "0.27.8", - "dev": true, "license": "MIT" }, "node_modules/@sindresorhus/merge-streams": { @@ -13608,7 +13540,6 @@ }, "node_modules/@sinonjs/commons": { "version": "3.0.1", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "type-detect": "4.0.8" @@ -13616,7 +13547,6 @@ }, "node_modules/@sinonjs/fake-timers": { "version": "10.3.0", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^3.0.0" @@ -13966,7 +13896,6 @@ }, "node_modules/@types/babel__core": { "version": "7.20.5", - "devOptional": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.20.7", @@ -13978,7 +13907,6 @@ }, "node_modules/@types/babel__generator": { "version": "7.6.8", - "devOptional": true, "license": "MIT", "dependencies": { "@babel/types": "^7.0.0" @@ -13986,7 +13914,6 @@ }, "node_modules/@types/babel__template": { "version": "7.4.4", - "devOptional": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.1.0", @@ -13995,7 +13922,6 @@ }, "node_modules/@types/babel__traverse": { "version": "7.20.6", - "devOptional": true, "license": "MIT", "dependencies": { "@babel/types": "^7.20.7" @@ -14189,7 +14115,6 @@ }, "node_modules/@types/graceful-fs": { "version": "4.1.9", - "dev": true, "license": "MIT", "dependencies": { "@types/node": "*" @@ -14225,12 +14150,10 @@ }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", - "dev": true, "license": "MIT" }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.3", - "dev": true, "license": "MIT", "dependencies": { "@types/istanbul-lib-coverage": "*" @@ -14238,16 +14161,15 @@ }, "node_modules/@types/istanbul-reports": { "version": "3.0.4", - "dev": true, "license": "MIT", "dependencies": { "@types/istanbul-lib-report": "*" } }, "node_modules/@types/jest": { - "version": "29.5.12", - "dev": true, - "license": "MIT", + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dependencies": { "expect": "^29.0.0", "pretty-format": "^29.0.0" @@ -14491,7 +14413,6 @@ }, "node_modules/@types/stack-utils": { "version": "2.0.3", - "dev": true, "license": "MIT" }, "node_modules/@types/trusted-types": { @@ -14524,7 +14445,6 @@ }, "node_modules/@types/yargs": { "version": "17.0.32", - "dev": true, "license": "MIT", "dependencies": { "@types/yargs-parser": "*" @@ -14532,7 +14452,6 @@ }, "node_modules/@types/yargs-parser": { "version": "21.0.3", - "dev": true, "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -15571,7 +15490,6 @@ }, "node_modules/ansi-escapes": { "version": "4.3.2", - "dev": true, "license": "MIT", "dependencies": { "type-fest": "^0.21.3" @@ -16067,7 +15985,6 @@ }, "node_modules/babel-jest": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/transform": "^29.7.0", @@ -16087,7 +16004,6 @@ }, "node_modules/babel-jest/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -16101,7 +16017,6 @@ }, "node_modules/babel-jest/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -16116,7 +16031,6 @@ }, "node_modules/babel-jest/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -16127,12 +16041,10 @@ }, "node_modules/babel-jest/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/babel-jest/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -16140,7 +16052,6 @@ }, "node_modules/babel-jest/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -16224,7 +16135,6 @@ }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", @@ -16239,7 +16149,6 @@ }, "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { "version": "5.2.1", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "@babel/core": "^7.12.3", @@ -16254,7 +16163,6 @@ }, "node_modules/babel-plugin-istanbul/node_modules/semver": { "version": "6.3.1", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -16262,7 +16170,6 @@ }, "node_modules/babel-plugin-jest-hoist": { "version": "29.6.3", - "dev": true, "license": "MIT", "dependencies": { "@babel/template": "^7.3.3", @@ -16329,7 +16236,6 @@ }, "node_modules/babel-preset-current-node-syntax": { "version": "1.0.1", - "dev": true, "license": "MIT", "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", @@ -16351,7 +16257,6 @@ }, "node_modules/babel-preset-jest": { "version": "29.6.3", - "dev": true, "license": "MIT", "dependencies": { "babel-plugin-jest-hoist": "^29.6.3", @@ -16831,7 +16736,6 @@ }, "node_modules/bs-logger": { "version": "0.2.6", - "dev": true, "license": "MIT", "dependencies": { "fast-json-stable-stringify": "2.x" @@ -16858,7 +16762,6 @@ }, "node_modules/bser": { "version": "2.1.1", - "dev": true, "license": "Apache-2.0", "dependencies": { "node-int64": "^0.4.0" @@ -17091,7 +16994,6 @@ }, "node_modules/char-regex": { "version": "1.0.2", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -17156,7 +17058,6 @@ }, "node_modules/ci-info": { "version": "3.9.0", - "dev": true, "funding": [ { "type": "github", @@ -17556,7 +17457,6 @@ }, "node_modules/co": { "version": "4.6.0", - "dev": true, "license": "MIT", "engines": { "iojs": ">= 1.0.0", @@ -17565,7 +17465,6 @@ }, "node_modules/collect-v8-coverage": { "version": "1.0.2", - "dev": true, "license": "MIT" }, "node_modules/collection-visit": { @@ -18438,7 +18337,6 @@ }, "node_modules/create-jest": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -18458,7 +18356,6 @@ }, "node_modules/create-jest/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -18472,14 +18369,12 @@ }, "node_modules/create-jest/node_modules/arg": { "version": "4.1.3", - "dev": true, "license": "MIT", "optional": true, "peer": true }, "node_modules/create-jest/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -18488,7 +18383,6 @@ }, "node_modules/create-jest/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -18503,7 +18397,6 @@ }, "node_modules/create-jest/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -18514,12 +18407,10 @@ }, "node_modules/create-jest/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/create-jest/node_modules/glob": { "version": "7.2.3", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -18538,7 +18429,6 @@ }, "node_modules/create-jest/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -18546,7 +18436,6 @@ }, "node_modules/create-jest/node_modules/jest-config": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", @@ -18590,7 +18479,6 @@ }, "node_modules/create-jest/node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -18601,7 +18489,6 @@ }, "node_modules/create-jest/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -18612,7 +18499,6 @@ }, "node_modules/create-jest/node_modules/ts-node": { "version": "10.9.2", - "dev": true, "license": "MIT", "optional": true, "peer": true, @@ -19480,7 +19366,6 @@ }, "node_modules/detect-newline": { "version": "3.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -19529,7 +19414,6 @@ }, "node_modules/diff-sequences": { "version": "29.6.3", - "dev": true, "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -19868,7 +19752,6 @@ }, "node_modules/emittery": { "version": "0.13.1", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -20934,7 +20817,6 @@ }, "node_modules/exit": { "version": "0.1.2", - "dev": true, "engines": { "node": ">= 0.8.0" } @@ -21020,7 +20902,6 @@ }, "node_modules/expect": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/expect-utils": "^29.7.0", @@ -21275,7 +21156,6 @@ }, "node_modules/fb-watchman": { "version": "2.0.2", - "dev": true, "license": "Apache-2.0", "dependencies": { "bser": "2.1.1" @@ -21815,7 +21695,6 @@ }, "node_modules/get-package-type": { "version": "0.1.0", - "devOptional": true, "license": "MIT", "engines": { "node": ">=8.0.0" @@ -22776,7 +22655,6 @@ }, "node_modules/html-escaper": { "version": "2.0.2", - "dev": true, "license": "MIT" }, "node_modules/html-tokenize": { @@ -23080,7 +22958,6 @@ }, "node_modules/import-local": { "version": "3.1.0", - "dev": true, "license": "MIT", "dependencies": { "pkg-dir": "^4.2.0", @@ -23567,7 +23444,6 @@ }, "node_modules/is-generator-fn": { "version": "2.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -24075,7 +23951,6 @@ }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=8" @@ -24083,7 +23958,6 @@ }, "node_modules/istanbul-lib-instrument": { "version": "6.0.2", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "@babel/core": "^7.23.9", @@ -24098,7 +23972,6 @@ }, "node_modules/istanbul-lib-report": { "version": "3.0.1", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "istanbul-lib-coverage": "^3.0.0", @@ -24111,7 +23984,6 @@ }, "node_modules/istanbul-lib-report/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -24119,7 +23991,6 @@ }, "node_modules/istanbul-lib-report/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -24130,7 +24001,6 @@ }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "debug": "^4.1.1", @@ -24143,7 +24013,6 @@ }, "node_modules/istanbul-lib-source-maps/node_modules/source-map": { "version": "0.6.1", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -24151,7 +24020,6 @@ }, "node_modules/istanbul-reports": { "version": "3.1.7", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "html-escaper": "^2.0.0", @@ -24291,8 +24159,8 @@ }, "node_modules/jest": { "version": "29.7.0", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -24316,7 +24184,6 @@ }, "node_modules/jest-changed-files": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "execa": "^5.0.0", @@ -24329,7 +24196,6 @@ }, "node_modules/jest-circus": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", @@ -24359,7 +24225,6 @@ }, "node_modules/jest-circus/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -24373,7 +24238,6 @@ }, "node_modules/jest-circus/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -24388,7 +24252,6 @@ }, "node_modules/jest-circus/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -24399,12 +24262,10 @@ }, "node_modules/jest-circus/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-circus/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -24412,7 +24273,6 @@ }, "node_modules/jest-circus/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -24423,7 +24283,6 @@ }, "node_modules/jest-cli": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/core": "^29.7.0", @@ -24455,7 +24314,6 @@ }, "node_modules/jest-cli/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -24469,14 +24327,12 @@ }, "node_modules/jest-cli/node_modules/arg": { "version": "4.1.3", - "dev": true, "license": "MIT", "optional": true, "peer": true }, "node_modules/jest-cli/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -24485,7 +24341,6 @@ }, "node_modules/jest-cli/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -24500,7 +24355,6 @@ }, "node_modules/jest-cli/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -24511,12 +24365,10 @@ }, "node_modules/jest-cli/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-cli/node_modules/glob": { "version": "7.2.3", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -24535,7 +24387,6 @@ }, "node_modules/jest-cli/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -24543,7 +24394,6 @@ }, "node_modules/jest-cli/node_modules/jest-config": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", @@ -24587,7 +24437,6 @@ }, "node_modules/jest-cli/node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -24598,7 +24447,6 @@ }, "node_modules/jest-cli/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -24609,7 +24457,6 @@ }, "node_modules/jest-cli/node_modules/ts-node": { "version": "10.9.2", - "dev": true, "license": "MIT", "optional": true, "peer": true, @@ -24653,7 +24500,6 @@ }, "node_modules/jest-diff": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -24667,7 +24513,6 @@ }, "node_modules/jest-diff/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -24681,7 +24526,6 @@ }, "node_modules/jest-diff/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -24696,7 +24540,6 @@ }, "node_modules/jest-diff/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -24707,12 +24550,10 @@ }, "node_modules/jest-diff/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-diff/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -24720,7 +24561,6 @@ }, "node_modules/jest-diff/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -24731,7 +24571,6 @@ }, "node_modules/jest-docblock": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "detect-newline": "^3.0.0" @@ -24742,7 +24581,6 @@ }, "node_modules/jest-each": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -24757,7 +24595,6 @@ }, "node_modules/jest-each/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -24771,7 +24608,6 @@ }, "node_modules/jest-each/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -24786,7 +24622,6 @@ }, "node_modules/jest-each/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -24797,12 +24632,10 @@ }, "node_modules/jest-each/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-each/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -24810,7 +24643,6 @@ }, "node_modules/jest-each/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -24821,7 +24653,6 @@ }, "node_modules/jest-environment-node": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", @@ -24837,7 +24668,6 @@ }, "node_modules/jest-get-type": { "version": "29.6.3", - "dev": true, "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -24845,7 +24675,6 @@ }, "node_modules/jest-haste-map": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -24869,7 +24698,6 @@ }, "node_modules/jest-leak-detector": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "jest-get-type": "^29.6.3", @@ -24881,7 +24709,6 @@ }, "node_modules/jest-matcher-utils": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -24895,7 +24722,6 @@ }, "node_modules/jest-matcher-utils/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -24909,7 +24735,6 @@ }, "node_modules/jest-matcher-utils/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -24924,7 +24749,6 @@ }, "node_modules/jest-matcher-utils/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -24935,12 +24759,10 @@ }, "node_modules/jest-matcher-utils/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-matcher-utils/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -24948,7 +24770,6 @@ }, "node_modules/jest-matcher-utils/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -24959,7 +24780,6 @@ }, "node_modules/jest-message-util": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.12.13", @@ -24978,7 +24798,6 @@ }, "node_modules/jest-message-util/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -24992,7 +24811,6 @@ }, "node_modules/jest-message-util/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -25007,7 +24825,6 @@ }, "node_modules/jest-message-util/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -25018,12 +24835,10 @@ }, "node_modules/jest-message-util/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-message-util/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -25031,7 +24846,6 @@ }, "node_modules/jest-message-util/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -25042,7 +24856,6 @@ }, "node_modules/jest-mock": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -25055,7 +24868,6 @@ }, "node_modules/jest-pnp-resolver": { "version": "1.2.3", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -25071,7 +24883,6 @@ }, "node_modules/jest-regex-util": { "version": "29.6.3", - "dev": true, "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -25079,7 +24890,6 @@ }, "node_modules/jest-resolve": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -25098,7 +24908,6 @@ }, "node_modules/jest-resolve-dependencies": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "jest-regex-util": "^29.6.3", @@ -25110,7 +24919,6 @@ }, "node_modules/jest-resolve/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -25124,7 +24932,6 @@ }, "node_modules/jest-resolve/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -25139,7 +24946,6 @@ }, "node_modules/jest-resolve/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -25150,12 +24956,10 @@ }, "node_modules/jest-resolve/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-resolve/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -25163,7 +24967,6 @@ }, "node_modules/jest-resolve/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -25174,7 +24977,6 @@ }, "node_modules/jest-runner": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/console": "^29.7.0", @@ -25205,7 +25007,6 @@ }, "node_modules/jest-runner/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -25219,7 +25020,6 @@ }, "node_modules/jest-runner/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -25234,7 +25034,6 @@ }, "node_modules/jest-runner/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -25245,12 +25044,10 @@ }, "node_modules/jest-runner/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-runner/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -25258,7 +25055,6 @@ }, "node_modules/jest-runner/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -25269,7 +25065,6 @@ }, "node_modules/jest-runtime": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", @@ -25301,7 +25096,6 @@ }, "node_modules/jest-runtime/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -25315,7 +25109,6 @@ }, "node_modules/jest-runtime/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -25324,7 +25117,6 @@ }, "node_modules/jest-runtime/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -25339,7 +25131,6 @@ }, "node_modules/jest-runtime/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -25350,12 +25141,10 @@ }, "node_modules/jest-runtime/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-runtime/node_modules/glob": { "version": "7.2.3", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -25374,7 +25163,6 @@ }, "node_modules/jest-runtime/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -25382,7 +25170,6 @@ }, "node_modules/jest-runtime/node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -25393,7 +25180,6 @@ }, "node_modules/jest-runtime/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -25404,7 +25190,6 @@ }, "node_modules/jest-snapshot": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", @@ -25434,7 +25219,6 @@ }, "node_modules/jest-snapshot/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -25448,7 +25232,6 @@ }, "node_modules/jest-snapshot/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -25463,7 +25246,6 @@ }, "node_modules/jest-snapshot/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -25474,12 +25256,10 @@ }, "node_modules/jest-snapshot/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-snapshot/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -25487,7 +25267,6 @@ }, "node_modules/jest-snapshot/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -25498,7 +25277,6 @@ }, "node_modules/jest-util": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -25514,7 +25292,6 @@ }, "node_modules/jest-util/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -25528,7 +25305,6 @@ }, "node_modules/jest-util/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -25543,7 +25319,6 @@ }, "node_modules/jest-util/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -25554,12 +25329,10 @@ }, "node_modules/jest-util/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-util/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -25567,7 +25340,6 @@ }, "node_modules/jest-util/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -25578,7 +25350,6 @@ }, "node_modules/jest-validate": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -25594,7 +25365,6 @@ }, "node_modules/jest-validate/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -25608,7 +25378,6 @@ }, "node_modules/jest-validate/node_modules/camelcase": { "version": "6.3.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -25619,7 +25388,6 @@ }, "node_modules/jest-validate/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -25634,7 +25402,6 @@ }, "node_modules/jest-validate/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -25645,12 +25412,10 @@ }, "node_modules/jest-validate/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-validate/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -25658,7 +25423,6 @@ }, "node_modules/jest-validate/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -25669,7 +25433,6 @@ }, "node_modules/jest-watcher": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/test-result": "^29.7.0", @@ -25687,7 +25450,6 @@ }, "node_modules/jest-watcher/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -25701,7 +25463,6 @@ }, "node_modules/jest-watcher/node_modules/chalk": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -25716,7 +25477,6 @@ }, "node_modules/jest-watcher/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -25727,12 +25487,10 @@ }, "node_modules/jest-watcher/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-watcher/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -25740,7 +25498,6 @@ }, "node_modules/jest-watcher/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -25751,7 +25508,6 @@ }, "node_modules/jest-worker": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", @@ -25765,7 +25521,6 @@ }, "node_modules/jest-worker/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -25773,7 +25528,6 @@ }, "node_modules/jest-worker/node_modules/supports-color": { "version": "8.1.1", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -26354,7 +26108,6 @@ }, "node_modules/kleur": { "version": "3.0.3", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -26774,7 +26527,6 @@ }, "node_modules/lodash.memoize": { "version": "4.1.2", - "dev": true, "license": "MIT" }, "node_modules/lodash.merge": { @@ -26945,7 +26697,6 @@ }, "node_modules/make-dir": { "version": "4.0.0", - "dev": true, "license": "MIT", "dependencies": { "semver": "^7.5.3" @@ -26963,7 +26714,6 @@ }, "node_modules/makeerror": { "version": "1.0.12", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "tmpl": "1.0.5" @@ -29962,7 +29712,6 @@ }, "node_modules/node-int64": { "version": "0.4.0", - "dev": true, "license": "MIT" }, "node_modules/node-releases": { @@ -31896,7 +31645,6 @@ }, "node_modules/pretty-format": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", @@ -31909,7 +31657,6 @@ }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -31954,7 +31701,6 @@ }, "node_modules/prompts": { "version": "2.4.2", - "dev": true, "license": "MIT", "dependencies": { "kleur": "^3.0.3", @@ -32143,7 +31889,6 @@ }, "node_modules/pure-rand": { "version": "6.1.0", - "dev": true, "funding": [ { "type": "individual", @@ -34298,7 +34043,6 @@ }, "node_modules/resolve-cwd": { "version": "3.0.0", - "dev": true, "license": "MIT", "dependencies": { "resolve-from": "^5.0.0" @@ -34309,7 +34053,6 @@ }, "node_modules/resolve-cwd/node_modules/resolve-from": { "version": "5.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -34336,7 +34079,6 @@ }, "node_modules/resolve.exports": { "version": "2.0.2", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -35290,7 +35032,6 @@ }, "node_modules/sisteransi": { "version": "1.0.5", - "dev": true, "license": "MIT" }, "node_modules/slash": { @@ -35534,7 +35275,6 @@ }, "node_modules/source-map-support": { "version": "0.5.13", - "dev": true, "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", @@ -35543,12 +35283,10 @@ }, "node_modules/source-map-support/node_modules/buffer-from": { "version": "1.1.2", - "dev": true, "license": "MIT" }, "node_modules/source-map-support/node_modules/source-map": { "version": "0.6.1", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -35634,7 +35372,6 @@ }, "node_modules/sprintf-js": { "version": "1.0.3", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/sql-formatter": { @@ -35651,7 +35388,6 @@ }, "node_modules/stack-utils": { "version": "2.0.6", - "dev": true, "license": "MIT", "dependencies": { "escape-string-regexp": "^2.0.0" @@ -35662,7 +35398,6 @@ }, "node_modules/stack-utils/node_modules/escape-string-regexp": { "version": "2.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -35810,7 +35545,6 @@ }, "node_modules/string-length": { "version": "4.0.2", - "dev": true, "license": "MIT", "dependencies": { "char-regex": "^1.0.2", @@ -35956,7 +35690,6 @@ }, "node_modules/strip-bom": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -36607,7 +36340,6 @@ }, "node_modules/test-exclude": { "version": "6.0.0", - "dev": true, "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", @@ -36620,7 +36352,6 @@ }, "node_modules/test-exclude/node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -36629,7 +36360,6 @@ }, "node_modules/test-exclude/node_modules/glob": { "version": "7.2.3", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -36648,7 +36378,6 @@ }, "node_modules/test-exclude/node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -36779,7 +36508,6 @@ }, "node_modules/tmpl": { "version": "1.0.5", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/to-fast-properties": { @@ -36979,18 +36707,19 @@ "license": "Apache-2.0" }, "node_modules/ts-jest": { - "version": "29.1.4", - "dev": true, - "license": "MIT", + "version": "29.2.5", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", + "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", "dependencies": { - "bs-logger": "0.x", - "fast-json-stable-stringify": "2.x", + "bs-logger": "^0.2.6", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "^2.1.0", "jest-util": "^29.0.0", "json5": "^2.2.3", - "lodash.memoize": "4.x", - "make-error": "1.x", - "semver": "^7.5.3", - "yargs-parser": "^21.0.1" + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.6.3", + "yargs-parser": "^21.1.1" }, "bin": { "ts-jest": "cli.js" @@ -37024,6 +36753,17 @@ } } }, + "node_modules/ts-jest/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ts-loader": { "version": "9.5.1", "license": "MIT", @@ -37289,7 +37029,6 @@ }, "node_modules/type-detect": { "version": "4.0.8", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -37297,7 +37036,6 @@ }, "node_modules/type-fest": { "version": "0.21.3", - "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" @@ -38140,7 +37878,6 @@ }, "node_modules/v8-to-istanbul": { "version": "9.2.0", - "dev": true, "license": "ISC", "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", @@ -38153,7 +37890,6 @@ }, "node_modules/v8-to-istanbul/node_modules/convert-source-map": { "version": "2.0.0", - "dev": true, "license": "MIT" }, "node_modules/validate-npm-package-license": { @@ -38312,7 +38048,6 @@ }, "node_modules/walker": { "version": "1.0.8", - "dev": true, "license": "Apache-2.0", "dependencies": { "makeerror": "1.0.12" @@ -39181,7 +38916,6 @@ }, "node_modules/write-file-atomic": { "version": "4.0.2", - "dev": true, "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", @@ -39551,13 +39285,16 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@types/jest": "^29.5.14", "dotenv": "^16.4.5", "http-errors": "^2.0.0", + "jest": "^29.7.0", "pino": "^9.5.0", "pino-cloud-logging": "^1.0.6", "pino-fluentd": "^0.2.4", "pino-pretty": "^11.3.0", "stream": "^0.0.3", + "ts-jest": "^29.2.5", "zod": "^3.23.8" }, "devDependencies": { diff --git a/packages/logging/jest.config.js b/packages/logging/jest.config.js new file mode 100644 index 000000000..f9699d903 --- /dev/null +++ b/packages/logging/jest.config.js @@ -0,0 +1,7 @@ +module.exports = { + preset: "ts-jest", + testEnvironment: "node", + testMatch: ["**/src/**/*.spec.ts"], + verbose: true, + }; + \ No newline at end of file diff --git a/packages/logging/package.json b/packages/logging/package.json index 01d5a8ca4..4860168b3 100644 --- a/packages/logging/package.json +++ b/packages/logging/package.json @@ -6,18 +6,22 @@ "scripts": { "format": "prettier --write ./*.{ts,json} **/*.{ts,json}", "lint": "eslint .", - "update-apps-local-deps": "mvm-update" + "update-apps-local-deps": "mvm-update", + "test": "jest" }, "author": "", "license": "ISC", "dependencies": { + "@types/jest": "^29.5.14", "dotenv": "^16.4.5", "http-errors": "^2.0.0", + "jest": "^29.7.0", "pino": "^9.5.0", "pino-cloud-logging": "^1.0.6", "pino-fluentd": "^0.2.4", "pino-pretty": "^11.3.0", "stream": "^0.0.3", + "ts-jest": "^29.1.4", "zod": "^3.23.8" }, "devDependencies": { diff --git a/packages/logging/src/servicies/logger/logger.service.spec.ts b/packages/logging/src/servicies/logger/logger.service.spec.ts new file mode 100644 index 000000000..f2d684800 --- /dev/null +++ b/packages/logging/src/servicies/logger/logger.service.spec.ts @@ -0,0 +1,122 @@ +import createHttpError from "http-errors"; +import pino from "pino"; +import pinoFluentd from "pino-fluentd"; +import pretty from "pino-pretty"; + +import { config } from "../../config"; +import { Logger, LoggerService } from "./logger.service"; + +jest.mock("pino"); +jest.mock("pino-fluentd"); +jest.mock("pino-pretty"); + +describe("LoggerService", () => { + let loggerService: LoggerService; + let mockLogger: jest.Mocked; + const defaultLogFormat = config.STD_OUT_LOG_FORMAT; + const defaultFluentdTag = config.FLUENTD_TAG; + const defaultFluentdHost = config.FLUENTD_HOST; + const defaultFluentdPort = config.FLUENTD_PORT; + + beforeEach(() => { + mockLogger = { + info: jest.fn(), + error: jest.fn(), + warn: jest.fn(), + debug: jest.fn(), + child: jest.fn().mockReturnThis() + } as unknown as jest.Mocked; + + (pino as unknown as jest.Mock).mockReturnValue(mockLogger); + loggerService = new LoggerService(); + }); + + afterEach(() => { + config.STD_OUT_LOG_FORMAT = defaultLogFormat; + config.FLUENTD_TAG = defaultFluentdTag; + config.FLUENTD_HOST = defaultFluentdHost; + config.FLUENTD_PORT = defaultFluentdPort; + jest.clearAllMocks(); + }); + + describe("prototype.initPino", () => { + it("should initialize pino with pretty formatting when STD_OUT_LOG_FORMAT is 'pretty'", () => { + config.STD_OUT_LOG_FORMAT = "pretty"; + new LoggerService(); + expect(pretty).toHaveBeenCalledWith({ sync: true }); + }); + + it("should initialize pino without pretty formatting for other formats", () => { + config.STD_OUT_LOG_FORMAT = "json"; + new LoggerService(); + expect(pretty).not.toHaveBeenCalled(); + expect(pino).toHaveBeenCalled(); + }); + + it("should initialize fluentd if configuration is enabled", () => { + config.FLUENTD_HOST = "localhost"; + config.FLUENTD_PORT = 24224; + config.FLUENTD_TAG = "app"; + + new LoggerService(); + expect(pinoFluentd).toHaveBeenCalledWith({ + tag: config.FLUENTD_TAG, + host: config.FLUENTD_HOST, + port: config.FLUENTD_PORT, + "trace-level": config.LOG_LEVEL + }); + }); + + it("should not initialize fluentd if configuration is missing", () => { + config.FLUENTD_HOST = ""; + config.FLUENTD_PORT = 0; + config.FLUENTD_TAG = ""; + + new LoggerService(); + expect(pinoFluentd).not.toHaveBeenCalled(); + }); + }); + + const methods: (keyof Logger)[] = ["info", "error", "warn", "debug"]; + describe.each(methods)("prototype.%s", method => { + const logMessage = "Test message"; + + it(`should call pino.${method} on info method`, () => { + loggerService[method](logMessage); + expect(mockLogger[method]).toHaveBeenCalledWith(logMessage); + }); + }); + + describe("prototype.toLoggableInput", () => { + it("should return status, message, stack, and data for HttpError", () => { + const httpError = createHttpError(404, { + status: 404, + message: "Not found", + stack: "stack trace", + data: { key: "value" }, + originalError: new Error("Original error") + }); + + const loggable = loggerService["toLoggableInput"](httpError); + expect(loggable).toEqual({ + status: 404, + message: "Not found", + stack: "stack trace", + data: { key: "value" }, + originalError: "stack trace" + }); + }); + + it("should return stack for general Error instance", () => { + const error = new Error("Test error"); + const loggable = loggerService["toLoggableInput"](error); + expect(loggable).toBe(error.stack); + }); + + it("should return the original message if it is not an error", () => { + const message = "Test message"; + const loggable = loggerService["toLoggableInput"](message); + expect(loggable).toBe(message); + }); + }); +}); diff --git a/packages/logging/src/servicies/logger/logger.service.ts b/packages/logging/src/servicies/logger/logger.service.ts index 5d31f5fcb..3a293d8fa 100644 --- a/packages/logging/src/servicies/logger/logger.service.ts +++ b/packages/logging/src/servicies/logger/logger.service.ts @@ -1,6 +1,6 @@ import { context, trace } from "@opentelemetry/api"; import { isHttpError } from "http-errors"; -import pino, { Bindings, LoggerOptions } from "pino"; +import pino, { Bindings, Logger as PinoLogger, LoggerOptions } from "pino"; import { gcpLogOptions } from "pino-cloud-logging"; import pinoFluentd from "pino-fluentd"; import pretty from "pino-pretty"; @@ -8,14 +8,16 @@ import { Writable } from "stream"; import { config } from "../../config"; -export class LoggerService { - protected pino: pino.Logger; +export type Logger = Pick; + +export class LoggerService implements Logger { + protected pino: Logger; constructor(bindings?: Bindings) { this.pino = this.initPino(bindings); } - private initPino(bindings?: Bindings): pino.Logger { + private initPino(bindings?: Bindings): Logger { const destinations: Writable[] = []; if (config.STD_OUT_LOG_FORMAT === "pretty") { @@ -94,9 +96,9 @@ export class LoggerService { const loggableInput = { status: message.status, message: message.message, stack: message.stack, data: message.data }; return "originalError" in message ? { - ...loggableInput, - originalError: message.stack - } + ...loggableInput, + originalError: message.stack + } : loggableInput; }