Repository: kubernetes-client/javascript
Pull request #2288 (2025-03-04 18:28:21)

Improve coverage and testability of config.ts


Patch:
diff --git a/package-lock.json b/package-lock.json
index d02edd6a..6f64e32b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -44,8 +44,8 @@
                 "ts-mockito": "^2.3.1",
                 "tsx": "^4.19.1",
                 "typedoc": "^0.27.1",
-                "typescript": "~5.8.2",
-                "typescript-eslint": "^8.26.0"
+                "typescript": "~5.7.2",
+                "typescript-eslint": "^8.20.0"
             }
         },
         "node_modules/@bcoe/v8-coverage": {
@@ -966,9 +966,9 @@
             }
         },
         "node_modules/@types/node": {
-            "version": "22.13.9",
-            "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.9.tgz",
-            "integrity": "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw==",
+            "version": "22.13.8",
+            "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.8.tgz",
+            "integrity": "sha512-G3EfaZS+iOGYWLLRCEAXdWK9my08oHNZ+FHluRiggIYJPOXzhOiDgpVCUHaUvyIC5/fj7C/p637jdzC666AOKQ==",
             "license": "MIT",
             "dependencies": {
                 "undici-types": "~6.20.0"
@@ -1024,17 +1024,17 @@
             }
         },
         "node_modules/@typescript-eslint/eslint-plugin": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.26.0.tgz",
-            "integrity": "sha512-cLr1J6pe56zjKYajK6SSSre6nl1Gj6xDp1TY0trpgPzjVbgDwd09v2Ws37LABxzkicmUjhEeg/fAUjPJJB1v5Q==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.25.0.tgz",
+            "integrity": "sha512-VM7bpzAe7JO/BFf40pIT1lJqS/z1F8OaSsUB3rpFJucQA4cOSuH2RVVVkFULN+En0Djgr29/jb4EQnedUo95KA==",
             "dev": true,
             "license": "MIT",
             "dependencies": {
                 "@eslint-community/regexpp": "^4.10.0",
-                "@typescript-eslint/scope-manager": "8.26.0",
-                "@typescript-eslint/type-utils": "8.26.0",
-                "@typescript-eslint/utils": "8.26.0",
-                "@typescript-eslint/visitor-keys": "8.26.0",
+                "@typescript-eslint/scope-manager": "8.25.0",
+                "@typescript-eslint/type-utils": "8.25.0",
+                "@typescript-eslint/utils": "8.25.0",
+                "@typescript-eslint/visitor-keys": "8.25.0",
                 "graphemer": "^1.4.0",
                 "ignore": "^5.3.1",
                 "natural-compare": "^1.4.0",
@@ -1050,20 +1050,20 @@
             "peerDependencies": {
                 "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0",
                 "eslint": "^8.57.0 || ^9.0.0",
-                "typescript": ">=4.8.4 <5.9.0"
+                "typescript": ">=4.8.4 <5.8.0"
             }
         },
         "node_modules/@typescript-eslint/parser": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.26.0.tgz",
-            "integrity": "sha512-mNtXP9LTVBy14ZF3o7JG69gRPBK/2QWtQd0j0oH26HcY/foyJJau6pNUez7QrM5UHnSvwlQcJXKsk0I99B9pOA==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.25.0.tgz",
+            "integrity": "sha512-4gbs64bnbSzu4FpgMiQ1A+D+urxkoJk/kqlDJ2W//5SygaEiAP2B4GoS7TEdxgwol2el03gckFV9lJ4QOMiiHg==",
             "dev": true,
             "license": "MIT",
             "dependencies": {
-                "@typescript-eslint/scope-manager": "8.26.0",
-                "@typescript-eslint/types": "8.26.0",
-                "@typescript-eslint/typescript-estree": "8.26.0",
-                "@typescript-eslint/visitor-keys": "8.26.0",
+                "@typescript-eslint/scope-manager": "8.25.0",
+                "@typescript-eslint/types": "8.25.0",
+                "@typescript-eslint/typescript-estree": "8.25.0",
+                "@typescript-eslint/visitor-keys": "8.25.0",
                 "debug": "^4.3.4"
             },
             "engines": {
@@ -1075,18 +1075,18 @@
             },
             "peerDependencies": {
                 "eslint": "^8.57.0 || ^9.0.0",
-                "typescript": ">=4.8.4 <5.9.0"
+                "typescript": ">=4.8.4 <5.8.0"
             }
         },
         "node_modules/@typescript-eslint/scope-manager": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.26.0.tgz",
-            "integrity": "sha512-E0ntLvsfPqnPwng8b8y4OGuzh/iIOm2z8U3S9zic2TeMLW61u5IH2Q1wu0oSTkfrSzwbDJIB/Lm8O3//8BWMPA==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.25.0.tgz",
+            "integrity": "sha512-6PPeiKIGbgStEyt4NNXa2ru5pMzQ8OYKO1hX1z53HMomrmiSB+R5FmChgQAP1ro8jMtNawz+TRQo/cSXrauTpg==",
             "dev": true,
             "license": "MIT",
             "dependencies": {
-                "@typescript-eslint/types": "8.26.0",
-                "@typescript-eslint/visitor-keys": "8.26.0"
+                "@typescript-eslint/types": "8.25.0",
+                "@typescript-eslint/visitor-keys": "8.25.0"
             },
             "engines": {
                 "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1097,14 +1097,14 @@
             }
         },
         "node_modules/@typescript-eslint/type-utils": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.26.0.tgz",
-            "integrity": "sha512-ruk0RNChLKz3zKGn2LwXuVoeBcUMh+jaqzN461uMMdxy5H9epZqIBtYj7UiPXRuOpaALXGbmRuZQhmwHhaS04Q==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.25.0.tgz",
+            "integrity": "sha512-d77dHgHWnxmXOPJuDWO4FDWADmGQkN5+tt6SFRZz/RtCWl4pHgFl3+WdYCn16+3teG09DY6XtEpf3gGD0a186g==",
             "dev": true,
             "license": "MIT",
             "dependencies": {
-                "@typescript-eslint/typescript-estree": "8.26.0",
-                "@typescript-eslint/utils": "8.26.0",
+                "@typescript-eslint/typescript-estree": "8.25.0",
+                "@typescript-eslint/utils": "8.25.0",
                 "debug": "^4.3.4",
                 "ts-api-utils": "^2.0.1"
             },
@@ -1117,13 +1117,13 @@
             },
             "peerDependencies": {
                 "eslint": "^8.57.0 || ^9.0.0",
-                "typescript": ">=4.8.4 <5.9.0"
+                "typescript": ">=4.8.4 <5.8.0"
             }
         },
         "node_modules/@typescript-eslint/types": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.26.0.tgz",
-            "integrity": "sha512-89B1eP3tnpr9A8L6PZlSjBvnJhWXtYfZhECqlBl1D9Lme9mHO6iWlsprBtVenQvY1HMhax1mWOjhtL3fh/u+pA==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.25.0.tgz",
+            "integrity": "sha512-+vUe0Zb4tkNgznQwicsvLUJgZIRs6ITeWSCclX1q85pR1iOiaj+4uZJIUp//Z27QWu5Cseiw3O3AR8hVpax7Aw==",
             "dev": true,
             "license": "MIT",
             "engines": {
@@ -1135,14 +1135,14 @@
             }
         },
         "node_modules/@typescript-eslint/typescript-estree": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.26.0.tgz",
-            "integrity": "sha512-tiJ1Hvy/V/oMVRTbEOIeemA2XoylimlDQ03CgPPNaHYZbpsc78Hmngnt+WXZfJX1pjQ711V7g0H7cSJThGYfPQ==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.25.0.tgz",
+            "integrity": "sha512-ZPaiAKEZ6Blt/TPAx5Ot0EIB/yGtLI2EsGoY6F7XKklfMxYQyvtL+gT/UCqkMzO0BVFHLDlzvFqQzurYahxv9Q==",
             "dev": true,
             "license": "MIT",
             "dependencies": {
-                "@typescript-eslint/types": "8.26.0",
-                "@typescript-eslint/visitor-keys": "8.26.0",
+                "@typescript-eslint/types": "8.25.0",
+                "@typescript-eslint/visitor-keys": "8.25.0",
                 "debug": "^4.3.4",
                 "fast-glob": "^3.3.2",
                 "is-glob": "^4.0.3",
@@ -1158,7 +1158,7 @@
                 "url": "https://opencollective.com/typescript-eslint"
             },
             "peerDependencies": {
-                "typescript": ">=4.8.4 <5.9.0"
+                "typescript": ">=4.8.4 <5.8.0"
             }
         },
         "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
@@ -1188,16 +1188,16 @@
             }
         },
         "node_modules/@typescript-eslint/utils": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.26.0.tgz",
-            "integrity": "sha512-2L2tU3FVwhvU14LndnQCA2frYC8JnPDVKyQtWFPf8IYFMt/ykEN1bPolNhNbCVgOmdzTlWdusCTKA/9nKrf8Ig==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.25.0.tgz",
+            "integrity": "sha512-syqRbrEv0J1wywiLsK60XzHnQe/kRViI3zwFALrNEgnntn1l24Ra2KvOAWwWbWZ1lBZxZljPDGOq967dsl6fkA==",
             "dev": true,
             "license": "MIT",
             "dependencies": {
                 "@eslint-community/eslint-utils": "^4.4.0",
-                "@typescript-eslint/scope-manager": "8.26.0",
-                "@typescript-eslint/types": "8.26.0",
-                "@typescript-eslint/typescript-estree": "8.26.0"
+                "@typescript-eslint/scope-manager": "8.25.0",
+                "@typescript-eslint/types": "8.25.0",
+                "@typescript-eslint/typescript-estree": "8.25.0"
             },
             "engines": {
                 "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1208,17 +1208,17 @@
             },
             "peerDependencies": {
                 "eslint": "^8.57.0 || ^9.0.0",
-                "typescript": ">=4.8.4 <5.9.0"
+                "typescript": ">=4.8.4 <5.8.0"
             }
         },
         "node_modules/@typescript-eslint/visitor-keys": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.26.0.tgz",
-            "integrity": "sha512-2z8JQJWAzPdDd51dRQ/oqIJxe99/hoLIqmf8RMCAJQtYDc535W/Jt2+RTP4bP0aKeBG1F65yjIZuczOXCmbWwg==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.25.0.tgz",
+            "integrity": "sha512-kCYXKAum9CecGVHGij7muybDfTS2sD3t0L4bJsEZLkyrXUImiCTq1M3LG2SRtOhiHFwMR9wAFplpT6XHYjTkwQ==",
             "dev": true,
             "license": "MIT",
             "dependencies": {
-                "@typescript-eslint/types": "8.26.0",
+                "@typescript-eslint/types": "8.25.0",
                 "eslint-visitor-keys": "^4.2.0"
             },
             "engines": {
@@ -1990,9 +1990,9 @@
             "license": "MIT"
         },
         "node_modules/fastq": {
-            "version": "1.19.1",
-            "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
-            "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==",
+            "version": "1.19.0",
+            "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz",
+            "integrity": "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==",
             "dev": true,
             "license": "ISC",
             "dependencies": {
@@ -3537,9 +3537,9 @@
             }
         },
         "node_modules/reusify": {
-            "version": "1.1.0",
-            "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
-            "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
+            "version": "1.0.4",
+            "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
+            "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
             "dev": true,
             "license": "MIT",
             "engines": {
@@ -4052,9 +4052,9 @@
             }
         },
         "node_modules/typescript": {
-            "version": "5.8.2",
-            "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
-            "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
+            "version": "5.7.3",
+            "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
+            "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
             "dev": true,
             "license": "Apache-2.0",
             "bin": {
@@ -4066,15 +4066,15 @@
             }
         },
         "node_modules/typescript-eslint": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.26.0.tgz",
-            "integrity": "sha512-PtVz9nAnuNJuAVeUFvwztjuUgSnJInODAUx47VDwWPXzd5vismPOtPtt83tzNXyOjVQbPRp786D6WFW/M2koIA==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.25.0.tgz",
+            "integrity": "sha512-TxRdQQLH4g7JkoFlYG3caW5v1S6kEkz8rqt80iQJZUYPq1zD1Ra7HfQBJJ88ABRaMvHAXnwRvRB4V+6sQ9xN5Q==",
             "dev": true,
             "license": "MIT",
             "dependencies": {
-                "@typescript-eslint/eslint-plugin": "8.26.0",
-                "@typescript-eslint/parser": "8.26.0",
-                "@typescript-eslint/utils": "8.26.0"
+                "@typescript-eslint/eslint-plugin": "8.25.0",
+                "@typescript-eslint/parser": "8.25.0",
+                "@typescript-eslint/utils": "8.25.0"
             },
             "engines": {
                 "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -4085,7 +4085,7 @@
             },
             "peerDependencies": {
                 "eslint": "^8.57.0 || ^9.0.0",
-                "typescript": ">=4.8.4 <5.9.0"
+                "typescript": ">=4.8.4 <5.8.0"
             }
         },
         "node_modules/uc.micro": {
@@ -4822,9 +4822,9 @@
             }
         },
         "@types/node": {
-            "version": "22.13.9",
-            "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.9.tgz",
-            "integrity": "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw==",
+            "version": "22.13.8",
+            "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.8.tgz",
+            "integrity": "sha512-G3EfaZS+iOGYWLLRCEAXdWK9my08oHNZ+FHluRiggIYJPOXzhOiDgpVCUHaUvyIC5/fj7C/p637jdzC666AOKQ==",
             "requires": {
                 "undici-types": "~6.20.0"
             }
@@ -4877,16 +4877,16 @@
             }
         },
         "@typescript-eslint/eslint-plugin": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.26.0.tgz",
-            "integrity": "sha512-cLr1J6pe56zjKYajK6SSSre6nl1Gj6xDp1TY0trpgPzjVbgDwd09v2Ws37LABxzkicmUjhEeg/fAUjPJJB1v5Q==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.25.0.tgz",
+            "integrity": "sha512-VM7bpzAe7JO/BFf40pIT1lJqS/z1F8OaSsUB3rpFJucQA4cOSuH2RVVVkFULN+En0Djgr29/jb4EQnedUo95KA==",
             "dev": true,
             "requires": {
                 "@eslint-community/regexpp": "^4.10.0",
-                "@typescript-eslint/scope-manager": "8.26.0",
-                "@typescript-eslint/type-utils": "8.26.0",
-                "@typescript-eslint/utils": "8.26.0",
-                "@typescript-eslint/visitor-keys": "8.26.0",
+                "@typescript-eslint/scope-manager": "8.25.0",
+                "@typescript-eslint/type-utils": "8.25.0",
+                "@typescript-eslint/utils": "8.25.0",
+                "@typescript-eslint/visitor-keys": "8.25.0",
                 "graphemer": "^1.4.0",
                 "ignore": "^5.3.1",
                 "natural-compare": "^1.4.0",
@@ -4894,54 +4894,54 @@
             }
         },
         "@typescript-eslint/parser": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.26.0.tgz",
-            "integrity": "sha512-mNtXP9LTVBy14ZF3o7JG69gRPBK/2QWtQd0j0oH26HcY/foyJJau6pNUez7QrM5UHnSvwlQcJXKsk0I99B9pOA==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.25.0.tgz",
+            "integrity": "sha512-4gbs64bnbSzu4FpgMiQ1A+D+urxkoJk/kqlDJ2W//5SygaEiAP2B4GoS7TEdxgwol2el03gckFV9lJ4QOMiiHg==",
             "dev": true,
             "requires": {
-                "@typescript-eslint/scope-manager": "8.26.0",
-                "@typescript-eslint/types": "8.26.0",
-                "@typescript-eslint/typescript-estree": "8.26.0",
-                "@typescript-eslint/visitor-keys": "8.26.0",
+                "@typescript-eslint/scope-manager": "8.25.0",
+                "@typescript-eslint/types": "8.25.0",
+                "@typescript-eslint/typescript-estree": "8.25.0",
+                "@typescript-eslint/visitor-keys": "8.25.0",
                 "debug": "^4.3.4"
             }
         },
         "@typescript-eslint/scope-manager": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.26.0.tgz",
-            "integrity": "sha512-E0ntLvsfPqnPwng8b8y4OGuzh/iIOm2z8U3S9zic2TeMLW61u5IH2Q1wu0oSTkfrSzwbDJIB/Lm8O3//8BWMPA==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.25.0.tgz",
+            "integrity": "sha512-6PPeiKIGbgStEyt4NNXa2ru5pMzQ8OYKO1hX1z53HMomrmiSB+R5FmChgQAP1ro8jMtNawz+TRQo/cSXrauTpg==",
             "dev": true,
             "requires": {
-                "@typescript-eslint/types": "8.26.0",
-                "@typescript-eslint/visitor-keys": "8.26.0"
+                "@typescript-eslint/types": "8.25.0",
+                "@typescript-eslint/visitor-keys": "8.25.0"
             }
         },
         "@typescript-eslint/type-utils": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.26.0.tgz",
-            "integrity": "sha512-ruk0RNChLKz3zKGn2LwXuVoeBcUMh+jaqzN461uMMdxy5H9epZqIBtYj7UiPXRuOpaALXGbmRuZQhmwHhaS04Q==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.25.0.tgz",
+            "integrity": "sha512-d77dHgHWnxmXOPJuDWO4FDWADmGQkN5+tt6SFRZz/RtCWl4pHgFl3+WdYCn16+3teG09DY6XtEpf3gGD0a186g==",
             "dev": true,
             "requires": {
-                "@typescript-eslint/typescript-estree": "8.26.0",
-                "@typescript-eslint/utils": "8.26.0",
+                "@typescript-eslint/typescript-estree": "8.25.0",
+                "@typescript-eslint/utils": "8.25.0",
                 "debug": "^4.3.4",
                 "ts-api-utils": "^2.0.1"
             }
         },
         "@typescript-eslint/types": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.26.0.tgz",
-            "integrity": "sha512-89B1eP3tnpr9A8L6PZlSjBvnJhWXtYfZhECqlBl1D9Lme9mHO6iWlsprBtVenQvY1HMhax1mWOjhtL3fh/u+pA==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.25.0.tgz",
+            "integrity": "sha512-+vUe0Zb4tkNgznQwicsvLUJgZIRs6ITeWSCclX1q85pR1iOiaj+4uZJIUp//Z27QWu5Cseiw3O3AR8hVpax7Aw==",
             "dev": true
         },
         "@typescript-eslint/typescript-estree": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.26.0.tgz",
-            "integrity": "sha512-tiJ1Hvy/V/oMVRTbEOIeemA2XoylimlDQ03CgPPNaHYZbpsc78Hmngnt+WXZfJX1pjQ711V7g0H7cSJThGYfPQ==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.25.0.tgz",
+            "integrity": "sha512-ZPaiAKEZ6Blt/TPAx5Ot0EIB/yGtLI2EsGoY6F7XKklfMxYQyvtL+gT/UCqkMzO0BVFHLDlzvFqQzurYahxv9Q==",
             "dev": true,
             "requires": {
-                "@typescript-eslint/types": "8.26.0",
-                "@typescript-eslint/visitor-keys": "8.26.0",
+                "@typescript-eslint/types": "8.25.0",
+                "@typescript-eslint/visitor-keys": "8.25.0",
                 "debug": "^4.3.4",
                 "fast-glob": "^3.3.2",
                 "is-glob": "^4.0.3",
@@ -4971,24 +4971,24 @@
             }
         },
         "@typescript-eslint/utils": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.26.0.tgz",
-            "integrity": "sha512-2L2tU3FVwhvU14LndnQCA2frYC8JnPDVKyQtWFPf8IYFMt/ykEN1bPolNhNbCVgOmdzTlWdusCTKA/9nKrf8Ig==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.25.0.tgz",
+            "integrity": "sha512-syqRbrEv0J1wywiLsK60XzHnQe/kRViI3zwFALrNEgnntn1l24Ra2KvOAWwWbWZ1lBZxZljPDGOq967dsl6fkA==",
             "dev": true,
             "requires": {
                 "@eslint-community/eslint-utils": "^4.4.0",
-                "@typescript-eslint/scope-manager": "8.26.0",
-                "@typescript-eslint/types": "8.26.0",
-                "@typescript-eslint/typescript-estree": "8.26.0"
+                "@typescript-eslint/scope-manager": "8.25.0",
+                "@typescript-eslint/types": "8.25.0",
+                "@typescript-eslint/typescript-estree": "8.25.0"
             }
         },
         "@typescript-eslint/visitor-keys": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.26.0.tgz",
-            "integrity": "sha512-2z8JQJWAzPdDd51dRQ/oqIJxe99/hoLIqmf8RMCAJQtYDc535W/Jt2+RTP4bP0aKeBG1F65yjIZuczOXCmbWwg==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.25.0.tgz",
+            "integrity": "sha512-kCYXKAum9CecGVHGij7muybDfTS2sD3t0L4bJsEZLkyrXUImiCTq1M3LG2SRtOhiHFwMR9wAFplpT6XHYjTkwQ==",
             "dev": true,
             "requires": {
-                "@typescript-eslint/types": "8.26.0",
+                "@typescript-eslint/types": "8.25.0",
                 "eslint-visitor-keys": "^4.2.0"
             }
         },
@@ -5523,9 +5523,9 @@
             "dev": true
         },
         "fastq": {
-            "version": "1.19.1",
-            "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
-            "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==",
+            "version": "1.19.0",
+            "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz",
+            "integrity": "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==",
             "dev": true,
             "requires": {
                 "reusify": "^1.0.4"
@@ -6581,9 +6581,9 @@
             "dev": true
         },
         "reusify": {
-            "version": "1.1.0",
-            "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
-            "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
+            "version": "1.0.4",
+            "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
+            "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
             "dev": true
         },
         "rfc4648": {
@@ -6913,20 +6913,20 @@
             }
         },
         "typescript": {
-            "version": "5.8.2",
-            "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
-            "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
+            "version": "5.7.3",
+            "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
+            "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
             "dev": true
         },
         "typescript-eslint": {
-            "version": "8.26.0",
-            "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.26.0.tgz",
-            "integrity": "sha512-PtVz9nAnuNJuAVeUFvwztjuUgSnJInODAUx47VDwWPXzd5vismPOtPtt83tzNXyOjVQbPRp786D6WFW/M2koIA==",
+            "version": "8.25.0",
+            "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.25.0.tgz",
+            "integrity": "sha512-TxRdQQLH4g7JkoFlYG3caW5v1S6kEkz8rqt80iQJZUYPq1zD1Ra7HfQBJJ88ABRaMvHAXnwRvRB4V+6sQ9xN5Q==",
             "dev": true,
             "requires": {
-                "@typescript-eslint/eslint-plugin": "8.26.0",
-                "@typescript-eslint/parser": "8.26.0",
-                "@typescript-eslint/utils": "8.26.0"
+                "@typescript-eslint/eslint-plugin": "8.25.0",
+                "@typescript-eslint/parser": "8.25.0",
+                "@typescript-eslint/utils": "8.25.0"
             }
         },
         "uc.micro": {
diff --git a/package.json b/package.json
index e7ee5cfa..9a29b0d1 100644
--- a/package.json
+++ b/package.json
@@ -89,8 +89,8 @@
         "ts-mockito": "^2.3.1",
         "tsx": "^4.19.1",
         "typedoc": "^0.27.1",
-        "typescript": "~5.8.2",
-        "typescript-eslint": "^8.26.0"
+        "typescript": "~5.7.2",
+        "typescript-eslint": "^8.20.0"
     },
     "bugs": {
         "url": "https://github.com/kubernetes-client/javascript/issues"
diff --git a/src/config.ts b/src/config.ts
index d7687315..482a12a8 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -394,7 +394,11 @@ export class KubeConfig implements SecurityAuthentication {
         this.contexts.push(ctx);
     }
 
-    public loadFromDefault(opts?: Partial<ConfigOptions>, contextFromStartingConfig: boolean = false): void {
+    public loadFromDefault(
+        opts?: Partial<ConfigOptions>,
+        contextFromStartingConfig: boolean = false,
+        platform: string = process.platform,
+    ): void {
         if (process.env.KUBECONFIG && process.env.KUBECONFIG.length > 0) {
             const files = process.env.KUBECONFIG.split(path.delimiter).filter((filename: string) => filename);
             this.loadFromFile(files[0], opts);
@@ -405,7 +409,7 @@ export class KubeConfig implements SecurityAuthentication {
             }
             return;
         }
-        const home = findHomeDir();
+        const home = findHomeDir(platform);
         if (home) {
             const config = path.join(home, '.kube', 'config');
             if (fileExists(config)) {
@@ -413,7 +417,7 @@ export class KubeConfig implements SecurityAuthentication {
                 return;
             }
         }
-        if (process.platform === 'win32') {
+        if (platform === 'win32') {
             try {
                 const envKubeconfigPathResult = child_process.spawnSync('wsl.exe', [
                     'bash',
@@ -628,8 +632,8 @@ function dropDuplicatesAndNils(a: string[]): string[] {
 }
 
 // Only public for testing.
-export function findHomeDir(): string | null {
-    if (process.platform !== 'win32') {
+export function findHomeDir(platform: string = process.platform): string | null {
+    if (platform !== 'win32') {
         if (process.env.HOME) {
             try {
                 fs.accessSync(process.env.HOME);


Test patch:
diff --git a/src/config_test.ts b/src/config_test.ts
index 07ad255b..9bb31dd5 100644
--- a/src/config_test.ts
+++ b/src/config_test.ts
@@ -1,9 +1,11 @@
 import { deepEqual, deepStrictEqual, notStrictEqual, rejects, strictEqual, throws } from 'node:assert';
+import child_process from 'node:child_process';
 import { readFileSync } from 'node:fs';
 import https from 'node:https';
 import { Agent, RequestOptions } from 'node:https';
 import path, { dirname, join } from 'node:path';
 import { fileURLToPath } from 'node:url';
+import { mock } from 'node:test';
 
 import mockfs from 'mock-fs';
 
@@ -301,8 +303,10 @@ describe('KubeConfig', () => {
             const kc = new KubeConfig();
             kc.loadFromFile(kcTlsServerNameFileName);
 
+            const requestContext = new RequestContext('https://kube.example.com', HttpMethod.GET);
             const opts: https.RequestOptions = {};
             await kc.applyToHTTPSOptions(opts);
+            await kc.applySecurityAuthentication(requestContext);
 
             const expectedAgent = new https.Agent({
                 ca: Buffer.from('CADATA2', 'utf-8'),
@@ -322,6 +326,7 @@ describe('KubeConfig', () => {
             };
 
             assertRequestOptionsEqual(opts, expectedOptions);
+            strictEqual((requestContext.getAgent()! as any).options.servername, 'kube.example2.com');
         });
         it('should apply cert configs', async () => {
             const kc = new KubeConfig();
@@ -1630,5 +1635,60 @@ describe('KubeConfig', () => {
             strictEqual(inputData!.toString(), data);
             mockfs.restore();
         });
+        it('should try to load from WSL on Windows with wsl.exe not working', () => {
+            const kc = new KubeConfig();
+            const commands: { command: string; args: string[] }[] = [];
+            mock.method(child_process, 'spawnSync', (cmd: string, args: string[]) => {
+                commands.push({ command: cmd, args });
+                return { status: 1, stderr: 'some error' };
+            });
+            kc.loadFromDefault(undefined, false, 'win32');
+            strictEqual(commands.length, 2);
+            for (let i = 0; i < commands.length; i++) {
+                strictEqual(commands[i].command, 'wsl.exe');
+            }
+        });
+        it('should try to load from WSL on Windows with $KUBECONFIG', () => {
+            const kc = new KubeConfig();
+            const test_path = 'C:\\Users\\user\\.kube\\config';
+            const configData = readFileSync(kcFileName);
+            const commands: { command: string; args: string[] }[] = [];
+            const results: { status: number; stderr: string; stdout: string }[] = [
+                { status: 0, stderr: '', stdout: test_path },
+                { status: 0, stderr: '', stdout: configData.toString() },
+            ];
+            let ix = 0;
+            mock.method(child_process, 'spawnSync', (cmd: string, args: string[]) => {
+                commands.push({ command: cmd, args });
+                return results[ix++];
+            });
+            kc.loadFromDefault(undefined, false, 'win32');
+            strictEqual(commands.length, 2);
+            for (let i = 0; i < commands.length; i++) {
+                strictEqual(commands[i].command, 'wsl.exe');
+            }
+            validateFileLoad(kc);
+        });
+        it('should try to load from WSL on Windows without $KUBECONFIG', () => {
+            const kc = new KubeConfig();
+            const configData = readFileSync(kcFileName);
+            const commands: { command: string; args: string[] }[] = [];
+            const results: { status: number; stderr: string; stdout: string }[] = [
+                { status: 1, stderr: 'Some Error', stdout: '' },
+                { status: 0, stderr: '', stdout: configData.toString() },
+                { status: 0, stderr: '', stdout: 'C:\\wsldata\\.kube' },
+            ];
+            let ix = 0;
+            mock.method(child_process, 'spawnSync', (cmd: string, args: string[]) => {
+                commands.push({ command: cmd, args });
+                return results[ix++];
+            });
+            kc.loadFromDefault(undefined, false, 'win32');
+            strictEqual(commands.length, 3);
+            for (let i = 0; i < commands.length; i++) {
+                strictEqual(commands[i].command, 'wsl.exe');
+            }
+            validateFileLoad(kc);
+        });
     });
 });