qgenutils
Version:
A security-first Node.js utility library providing authentication, HTTP operations, URL processing, validation, datetime formatting, and template rendering. Designed as a lightweight alternative to heavy npm packages with comprehensive error handling and
1 lines • 814 kB
JSON
{"file_contents":{"DEBUG_TESTS.md":{"content":"# Test Failure Analysis\n\n**Creation Time:** 2025-08-19T17:02:14.244Z\n**Pacific Time:** Tuesday, August 19, 2025 at 10:02:14 AM PDT\n\n⚠️ **STALENESS WARNING:** If your code changes are after the creation time above and you are checking this file, then it is stale and tests need to be rerun.\n\nAnalyze and address the following test failures:\n\n## Failed Test 1: config/localVars.test.js\n\n### Output:\n```\nFAIL lib/validation/github-validation.test.js\n GitHub Validation Utilities\n validateGitHubUrl\n ✓ should validate correct GitHub repository URLs (100 ms)\n ✓ should reject empty or invalid URLs (17 ms)\n ✓ should reject non-GitHub URLs (19 ms)\n ✓ should reject HTTP URLs (require HTTPS) (6 ms)\n ✓ should reject URLs with additional paths (27 ms)\n ✕ should handle malicious input safely (17 ms)\n\n ● GitHub Validation Utilities › validateGitHubUrl › should handle malicious input safely\n\n expect(received).toBe(expected) // Object.is equality\n\n Expected: \"Repository URL is required\"\n Received: \"Please enter a valid GitHub repository URL (e.g., https://github.com/user/repo)\"\n\n 45 | test('should handle malicious input safely', () => {\n 46 | const errorMsg = 'Please enter a valid GitHub repository URL (e.g., https://github.com/user/repo)';\n > 47 | expect(validateGitHubUrl('<script>alert(\"xss\")</script>')).toBe('Repository URL is required');\n | ^\n 48 | expect(validateGitHubUrl('javascript:alert(\"test\")')).toBe(errorMsg);\n 49 | expect(validateGitHubUrl('https://github.com/../user/repo')).toBe(errorMsg);\n 50 | });\n\n at Object.toBe (lib/validation/github-validation.test.js:47:66)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/github-validation.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/github-validation.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nFAIL lib/validation/validation.test.js\n Validation Utilities\n requireFields\n ✓ should return true when all required fields are present (15 ms)\n ✕ should return false and send error for missing fields (15 ms)\n ✕ should return false for multiple missing fields (3 ms)\n ✕ should treat falsy values as missing (3 ms)\n ✓ should handle empty object (3 ms)\n ✓ should handle empty required fields array (2 ms)\n ✕ should handle undefined object gracefully (4 ms)\n ✕ should handle null object gracefully (8 ms)\n ✓ should accept truthy values (1 ms)\n ✕ should handle invalid requiredFields parameter (7 ms)\n ✕ should handle non-array requiredFields parameter (6 ms)\n ✕ should handle invalid obj parameter (4 ms)\n\n ● Validation Utilities › requireFields › should return false and send error for missing fields\n\n expect(jest.fn()).toHaveBeenCalledWith(...expected)\n\n - Expected\n + Received\n\n Object {\n - \"error\": \"Missing required fields\",\n - \"missing\": Array [\n + \"error\": \"Validation failed\",\n + \"message\": \"Missing required fields: email\",\n + \"missingFields\": Array [\n \"email\",\n ],\n },\n\n Number of calls: 1\n\n 32 | expect(result).toBe(false); // missing email triggers failure\n 33 | expect(mockRes.status).toHaveBeenCalledWith(400); // returns bad request\n > 34 | expect(mockRes.json).toHaveBeenCalledWith({\n | ^\n 35 | error: 'Missing required fields',\n 36 | missing: ['email']\n 37 | });\n\n at Object.toHaveBeenCalledWith (lib/validation/validation.test.js:34:28)\n\n ● Validation Utilities › requireFields › should return false for multiple missing fields\n\n expect(jest.fn()).toHaveBeenCalledWith(...expected)\n\n - Expected\n + Received\n\n Object {\n - \"error\": \"Missing required fields\",\n - \"missing\": Array [\n + \"error\": \"Validation failed\",\n + \"message\": \"Missing required fields: email, age\",\n + \"missingFields\": Array [\n \"email\",\n \"age\",\n ],\n },\n\n Number of calls: 1\n\n 45 | expect(result).toBe(false); // multiple fields missing\n 46 | expect(mockRes.status).toHaveBeenCalledWith(400); // status set once\n > 47 | expect(mockRes.json).toHaveBeenCalledWith({\n | ^\n 48 | error: 'Missing required fields',\n 49 | missing: ['email', 'age']\n 50 | });\n\n at Object.toHaveBeenCalledWith (lib/validation/validation.test.js:47:28)\n\n ● Validation Utilities › requireFields › should treat falsy values as missing\n\n expect(jest.fn()).toHaveBeenCalledWith(...expected)\n\n - Expected\n + Received\n\n Object {\n - \"error\": \"Missing required fields\",\n - \"missing\": Array [\n + \"error\": \"Validation failed\",\n + \"message\": \"Missing required fields: name, email\",\n + \"missingFields\": Array [\n \"name\",\n \"email\",\n - \"age\",\n - \"active\",\n ],\n },\n\n Number of calls: 1\n\n 58 | expect(result).toBe(false); // falsy values considered missing\n 59 | expect(mockRes.status).toHaveBeenCalledWith(400); // still 400 response\n > 60 | expect(mockRes.json).toHaveBeenCalledWith({\n | ^\n 61 | error: 'Missing required fields',\n 62 | missing: ['name', 'email', 'age', 'active']\n 63 | });\n\n at Object.toHaveBeenCalledWith (lib/validation/validation.test.js:60:28)\n\n ● Validation Utilities › requireFields › should handle undefined object gracefully\n\n expect(received).toBe(expected) // Object.is equality\n\n Expected: false\n Received: {\"json\": [Function mockConstructor], \"status\": [Function mockConstructor]}\n\n 86 | const result = requireFields(undefined, ['name'], mockRes);\n 87 | \n > 88 | expect(result).toBe(false); // invalid obj returns false\n | ^\n 89 | expect(mockRes.status).toHaveBeenCalledWith(500); // internal error status\n 90 | expect(mockRes.json).toHaveBeenCalledWith({\n 91 | error: 'Internal validation error'\n\n at Object.toBe (lib/validation/validation.test.js:88:22)\n\n ● Validation Utilities › requireFields › should handle null object gracefully\n\n expect(received).toBe(expected) // Object.is equality\n\n Expected: false\n Received: {\"json\": [Function mockConstructor], \"status\": [Function mockConstructor]}\n\n 97 | const result = requireFields(null, ['name'], mockRes);\n 98 | \n > 99 | expect(result).toBe(false); // null object also invalid\n | ^\n 100 | expect(mockRes.status).toHaveBeenCalledWith(500); // internal error status\n 101 | });\n 102 |\n\n at Object.toBe (lib/validation/validation.test.js:99:22)\n\n ● Validation Utilities › requireFields › should handle invalid requiredFields parameter\n\n expect(received).toBe(expected) // Object.is equality\n\n Expected: false\n Received: true\n\n 121 | const result = requireFields(obj, null, mockRes);\n 122 | \n > 123 | expect(result).toBe(false); // invalid requiredFields parameter\n | ^\n 124 | expect(mockRes.status).toHaveBeenCalledWith(500); // internal error for invalid param\n 125 | expect(mockRes.json).toHaveBeenCalledWith({ error: 'Internal validation error' }); // send generic message\n 126 | });\n\n at Object.toBe (lib/validation/validation.test.js:123:22)\n\n ● Validation Utilities › requireFields › should handle non-array requiredFields parameter\n\n expect(received).toBe(expected) // Object.is equality\n\n Expected: false\n Received: true\n\n 131 | const result = requireFields(obj, 'name', mockRes);\n 132 | \n > 133 | expect(result).toBe(false); // non-array requiredFields not allowed\n | ^\n 134 | expect(mockRes.status).toHaveBeenCalledWith(500); // internal error\n 135 | expect(mockRes.json).toHaveBeenCalledWith({ error: 'Internal validation error' }); // error message\n 136 | });\n\n at Object.toBe (lib/validation/validation.test.js:133:22)\n\n ● Validation Utilities › requireFields › should handle invalid obj parameter\n\n expect(received).toBe(expected) // Object.is equality\n\n Expected: false\n Received: {\"json\": [Function mockConstructor], \"status\": [Function mockConstructor]}\n\n 140 | const result = requireFields(null, ['name'], mockRes);\n 141 | \n > 142 | expect(result).toBe(false); // null object again invalid\n | ^\n 143 | expect(mockRes.status).toHaveBeenCalledWith(500); // internal error\n 144 | expect(mockRes.json).toHaveBeenCalledWith({ error: 'Internal validation error' }); // respond with generic\n 145 | });\n\n at Object.toBe (lib/validation/validation.test.js:142:22)\n\nFAIL lib/utilities/datetime/datetime.test.js\n DateTime Utilities\n formatDate\n ✓ should format valid dates (43 ms)\n ✕ should handle invalid dates (4 ms)\n formatDateTime\n ✓ should format valid datetime (1 ms)\n formatDuration\n ✓ should format duration in milliseconds (3 ms)\n addDays\n ✕ should add days to date (3 ms)\n\n ● DateTime Utilities › formatDate › should handle invalid dates\n\n expect(received).toBe(expected) // Object.is equality\n\n Expected: \"N/A\"\n Received: \"Unknown\"\n\n 14 |\n 15 | test('should handle invalid dates', () => {\n > 16 | expect(formatDate(null)).toBe('N/A');\n | ^\n 17 | expect(formatDate(undefined)).toBe('N/A');\n 18 | expect(formatDate('invalid')).toBe('N/A');\n 19 | });\n\n at Object.toBe (lib/utilities/datetime/datetime.test.js:16:32)\n\n ● DateTime Utilities › addDays › should add days to date\n\n expect(received).toBe(expected) // Object.is equality\n\n Expected: 8\n Received: 17\n\n 42 | const result = addDays(testDate, 7);\n 43 | expect(result instanceof Date).toBe(true);\n > 44 | expect(result.getDate()).toBe(8);\n | ^\n 45 | });\n 46 | });\n 47 | });\n\n at Object.toBe (lib/utilities/datetime/datetime.test.js:44:32)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/datetime.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/datetime.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/system/realtime/createBroadcastRegistry.test.js\n createBroadcastRegistry.js\n ✓ createBroadcastRegistry works (3 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/validation.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/validation.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/utilities/file/formatFileSize.test.js\n formatFileSize.js\n ✓ formatFileSize works (6 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/file/formatFileSize.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/file/formatFileSize.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/system/shutdown/gracefulShutdown.test.js\n gracefulShutdown.js\n ✓ gracefulShutdown works (18 ms)\n ✓ shutdown works (1 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/system/shutdown/gracefulShutdown.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/system/shutdown/gracefulShutdown.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/system/shutdown/createShutdownManager.test.js\n createShutdownManager.js\n ✓ createShutdownManager works (32 ms)\n ✓ addHandler works\n ✓ executeHandlers works\n ✓ trigger works (1 ms)\n ✓ registerSignalHandlers works (1 ms)\n ✓ destroy works\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/system/shutdown/createShutdownManager.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/system/shutdown/createShutdownManager.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/utilities/datetime/addDays.test.js\n addDays.js\n ✓ addDays works (55 ms)\n ✓ isValidDate works (3 ms)\n\nPASS lib/utilities/id-generation/id-generation.test.js\n ID Generation Utilities\n generateExecutionId\n ✓ should generate unique execution IDs (29 ms)\n ✓ should generate IDs with proper format (3 ms)\n ✓ should be cryptographically secure (37 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/id-generation/id-generation.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/id-generation/id-generation.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/utilities/url/parseUrlParts.test.js\n parseUrlParts.js\n ✓ parseUrlParts works (1 ms)\n\nPASS lib/utilities/string/string-utils.test.js\n String Utilities\n sanitizeString\n ✓ should sanitize basic strings (33 ms)\n ✓ should handle empty input (8 ms)\n ✓ should handle special characters (25 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/string/string-utils.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/string/string-utils.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/addDays.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/addDays.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/utilities/url/ensureProtocol.test.js\n ensureProtocol.js\n ✓ ensureProtocol works (13 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/url/ensureProtocol.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/url/ensureProtocol.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/utilities/file/file-utils.test.js\n File Utilities\n formatFileSize\n ✓ should format bytes correctly (43 ms)\n ✓ should handle small files (3 ms)\n ✓ should handle invalid input (6 ms)\n\nPASS lib/utilities/datetime/formatDateTime.test.js\n formatDateTime.js\n ✓ formatDateTime works (13 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/formatDateTime.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\nPASS lib/system/env/requireEnvVars.test.js\n requireEnvVars.js\n ✓ requireEnvVars works (1 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/formatDateTime.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/file/file-utils.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/file/file-utils.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/validation/isValidDate.test.js\n isValidDate\n ✓ should return true for valid Date objects (20 ms)\n ✓ should return false for invalid Date objects (1 ms)\n ✓ should return false for non-Date values (2 ms)\n ✓ should handle edge cases (2 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/isValidDate.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/isValidDate.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/utilities/url/normalizeUrlOrigin.test.js\n normalizeUrlOrigin.js\n ✓ normalizeUrlOrigin works (11 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/url/normalizeUrlOrigin.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\nPASS lib/utilities/url/stripProtocol.test.js\n stripProtocol.js\n ✓ stripProtocol works (11 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/url/normalizeUrlOrigin.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/url/stripProtocol.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/url/stripProtocol.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/utilities/datetime/formatDateWithPrefix.test.js\n formatDateWithPrefix.js\n ✓ formatDateWithPrefix works (14 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/formatDateWithPrefix.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/formatDateWithPrefix.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/security/auth/hasGithubStrategy.test.js\n hasGithubStrategy.js\n ✓ hasGithubStrategy works (19 ms)\n ✓ logAuthOperation works (1 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/security/auth/hasGithubStrategy.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/security/auth/hasGithubStrategy.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/validation/input-validation.test.js\n Input Validation Utilities\n isValidObject\n ✓ should return true for plain object (20 ms)\n ✓ should return false for array\n ✓ should return false for null (1 ms)\n ✓ should return false for string (1 ms)\n ✓ should return false for undefined (1 ms)\n isValidString\n ✓ should return true for typical string (1 ms)\n ✓ should return false for empty string (1 ms)\n ✓ should return false for whitespace string (1 ms)\n ✓ should return false for null (1 ms)\n ✓ should return false for object (1 ms)\n hasMethod\n ✓ should return true when method exists (1 ms)\n ✓ should return false when method missing (1 ms)\n ✓ should return false when property is not function (1 ms)\n ✓ should handle getter throwing error (123 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/input-validation.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n at qerrors (node_modules/qerrors/lib/qerrors.js:387:10)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/input-validation.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n at qerrors (node_modules/qerrors/lib/qerrors.js:387:10)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n at qerrors (/home/runner/workspace/node_modules/qerrors/lib/qerrors.js:387:10)\n\nNode.js v20.19.3\nPASS lib/validation/hasMethod.test.js\n hasMethod\n ✓ should return true when object has the specified method (22 ms)\n ✓ should return false when object does not have the method (1 ms)\n ✓ should return false for non-objects\n ✓ should return false when method name is not a string (1 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/hasMethod.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/hasMethod.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/validation/requireFields.test.js\n requireFields.js\n ✓ requireFields works (26 ms)\n\nPASS lib/utilities/id-generation/generateExecutionId.test.js\n generateExecutionId.js\n ✓ generateExecutionId works (27 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/id-generation/generateExecutionId.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/id-generation/generateExecutionId.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/system/worker-pool/createWorkerPool.test.js\n createWorkerPool.js\n ✓ createWorkerPool works (1 ms)\n ✓ createWorker works\n ✓ replaceWorker works\n ✓ processQueue works (1 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/requireFields.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/requireFields.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/logger-test.test.js\n logger-test.js basic exports\n ✓ module loads without errors (46 ms)\n\nPASS lib/utilities/url/url.test.js\n URL Utilities\n ensureProtocol\n ✓ should add https to URLs without protocol (18 ms)\n ✓ should preserve existing protocols (2 ms)\n stripProtocol\n ✓ should remove protocols from URLs (2 ms)\n ✓ should handle URLs without protocols (1 ms)\n normalizeUrlOrigin\n ✓ should normalize URL origins (3 ms)\n parseUrlParts\n ✓ should parse URL components (3 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/url/url.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/url/url.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/security/auth/checkPassportAuth.test.js\n checkPassportAuth.js\n ✓ checkPassportAuth works (1 ms)\n ✓ logAuthOperation works\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/security/auth/checkPassportAuth.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/security/auth/checkPassportAuth.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/utilities/datetime/formatDuration.test.js\n formatDuration.js\n ✓ formatDuration works (17 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/formatDuration.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/formatDuration.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/security/auth/logAuthOperation.test.js\n logAuthOperation.js\n ✓ logAuthOperation works (55 ms)\n\nPASS lib/validation/isValidObject.test.js\n isValidObject\n ✓ should return true for plain objects (2 ms)\n ✓ should return false for arrays (1 ms)\n ✓ should return false for null and undefined (1 ms)\n ✓ should return false for primitives\n ✓ should return false for functions\n\nPASS lib/utilities/datetime/formatDate.test.js\n formatDate.js\n ✓ formatDate works (4 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/formatDate.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/utilities/datetime/formatDate.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/validation/validateGitHubUrl.test.js\n validateGitHubUrl.js\n ✓ validateGitHubUrl works (12 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/validateGitHubUrl.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/validateGitHubUrl.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/validation/validateRequired.test.js\n validateRequired.js\n ✓ validateRequired works (14 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/validateRequired.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/validation/validateRequired.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/system/env/hasEnvVar.test.js\n hasEnvVar.js\n ✓ hasEnvVar works (18 ms)\n\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/system/env/hasEnvVar.test.js.\n\n at buildLogger (node_modules/qerrors/lib/logger.js:152:33)\n\nReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From lib/system/env/hasEnvVar.test.js.\n\n at Object.get [as File] (node_modules/winston/lib/winston/transports/index.js:30:12)\n at node_modules/qerrors/lib/logger.js:164:57\n at buildLogger (node_modules/qerrors/lib/logger.js:171:11)\n/home/runner/workspace/node_modules/qerrors/lib/logger.js:164\n arr.push(new transports.File({ filename: path.join(logDir, 'error.log'), level: 'error', ...rotationOpts, maxFiles: fileCap, format: fileFormat })); //(size-based rotation for error files with count limit)\n ^\n\nTypeError: transports.File is not a constructor\n at /home/runner/workspace/node_modules/qerrors/lib/logger.js:164:42\n at buildLogger (/home/runner/workspace/node_modules/qerrors/lib/logger.js:171:11)\n\nNode.js v20.19.3\nPASS lib/logger.test.js\n Logger Utility\n ✓ verifies should configure DailyRotateFile transport (236 ms)\n\nPASS tests/jest.config.test.js\n jest.config.js\n ✓ collectCoverage works (1 ms)\n ✓ branches works (4 ms)\n ✓ functions works (1 ms)\n ✓ lines works (2 ms)\n\nPASS lib/utilities/string/sanitizeString.test.js\n sanitizeString.js\n ✓ sanitizeString works (10 ms)\n\nFAIL tests/integration/simplified-module-interactions.test.js\n ● Test suite failed to run\n\n Jest encountered an unexpected token\n\n Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.\n\n Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.\n\n By default \"node_modules\" folder is ignored by transformers.\n\n Here's w