@@ -108,6 +108,7 @@ describe("request", () => {
108108
109109 describe ( "Request Options" , ( ) => {
110110 test ( "provide only allowed options to fetch" , async ( ) => {
111+ globalThis . window = undefined !
111112 await request ( "GET" , testUrl , {
112113 signal : "test" as unknown as AbortSignal ,
113114 headers : { key1 : "value1" } ,
@@ -159,6 +160,7 @@ describe("request", () => {
159160
160161 describe ( "SSL Ignore Functionality" , ( ) => {
161162 test ( "should create HTTPS agent when ignoreSsl is true for HTTPS URL" , async ( ) => {
163+ globalThis . window = undefined !
162164 await request ( "GET" , testUrl , {
163165 ignoreSsl : true ,
164166 headers : { Authorization : "Bearer token" } ,
@@ -221,6 +223,7 @@ describe("request", () => {
221223 } )
222224
223225 test ( "should filter out ignoreSsl from fetch options" , async ( ) => {
226+ globalThis . window = undefined !
224227 await request ( "POST" , testUrl , {
225228 body : { data : "test" } ,
226229 headers : { "Content-Type" : "application/json" } ,
@@ -235,6 +238,7 @@ describe("request", () => {
235238 } )
236239
237240 test ( "should handle mixed requests with different SSL settings" , async ( ) => {
241+ globalThis . window = undefined !
238242 // First request with SSL verification (default)
239243 await request ( "GET" , testUrl , {
240244 headers : { Accept : "application/json" } ,
@@ -262,6 +266,7 @@ describe("request", () => {
262266 test ( "should work with all HTTP methods and ignoreSsl" , async ( ) => {
263267 const methods = [ "GET" , "POST" , "PUT" , "PATCH" , "DELETE" , "HEAD" ]
264268 const testBody = { test : "data" }
269+ globalThis . window = undefined !
265270
266271 for ( const method of methods ) {
267272 vi . clearAllMocks ( )
@@ -293,6 +298,7 @@ describe("request", () => {
293298 } )
294299
295300 test ( "should handle JSON body serialization with ignoreSsl" , async ( ) => {
301+ globalThis . window = undefined !
296302 const requestBody = {
297303 name : "test-resource" ,
298304 spec : { replicas : 3 } ,
@@ -315,6 +321,7 @@ describe("request", () => {
315321 } )
316322
317323 test ( "should handle string body without modification with ignoreSsl" , async ( ) => {
324+ globalThis . window = undefined !
318325 const stringBody = "raw string data"
319326
320327 await request ( "POST" , testUrl , {
@@ -331,6 +338,7 @@ describe("request", () => {
331338 } )
332339
333340 test ( "should handle URL parameters with ignoreSsl" , async ( ) => {
341+ globalThis . window = undefined !
334342 await request ( "GET" , testUrl , {
335343 params : {
336344 labelSelector : "app=nginx" ,
0 commit comments