@@ -193,41 +193,41 @@ describe('fetchWrapper (main)', () => {
193193 it ( 'should handle dynamic import for getFetch when no global fetch' , async ( ) => {
194194 // Clear the module cache to ensure fresh import
195195 jest . resetModules ( ) ;
196-
196+
197197 // Remove global fetch but keep global object
198198 delete ( global as any ) . fetch ;
199199
200200 const { getFetch } = await import ( '../../src/utils/fetchWrapper.js' ) ;
201201 const fetch = await getFetch ( ) ;
202-
202+
203203 expect ( mockDynamicImportMain ) . toHaveBeenCalledWith ( 'node-fetch' ) ;
204204 expect ( fetch ) . toBe ( mockNodeFetchMain . default ) ;
205205 } ) ;
206206
207207 it ( 'should handle dynamic import for getRequest when no global Request' , async ( ) => {
208208 // Clear the module cache to ensure fresh import
209209 jest . resetModules ( ) ;
210-
210+
211211 // Remove global Request but keep global object
212212 delete ( global as any ) . Request ;
213213
214214 const { getRequest } = await import ( '../../src/utils/fetchWrapper.js' ) ;
215215 const Request = await getRequest ( ) ;
216-
216+
217217 expect ( mockDynamicImportMain ) . toHaveBeenCalledWith ( 'node-fetch' ) ;
218218 expect ( Request ) . toBe ( mockNodeFetchMain . Request ) ;
219219 } ) ;
220220
221221 it ( 'should handle dynamic import for getResponse when no global Response' , async ( ) => {
222222 // Clear the module cache to ensure fresh import
223223 jest . resetModules ( ) ;
224-
224+
225225 // Remove global Response but keep global object
226226 delete ( global as any ) . Response ;
227227
228228 const { getResponse } = await import ( '../../src/utils/fetchWrapper.js' ) ;
229229 const Response = await getResponse ( ) ;
230-
230+
231231 expect ( mockDynamicImportMain ) . toHaveBeenCalledWith ( 'node-fetch' ) ;
232232 expect ( Response ) . toBe ( mockNodeFetchMain . Response ) ;
233233 } ) ;
@@ -236,25 +236,27 @@ describe('fetchWrapper (main)', () => {
236236 // Clear the module cache to ensure fresh import
237237 jest . resetModules ( ) ;
238238 jest . clearAllMocks ( ) ;
239-
239+
240240 // Remove all global objects
241241 delete ( global as any ) . fetch ;
242242 delete ( global as any ) . Request ;
243243 delete ( global as any ) . Response ;
244244
245- const { getFetch, getRequest, getResponse } = await import ( '../../src/utils/fetchWrapper.js' ) ;
246-
245+ const { getFetch, getRequest, getResponse } = await import (
246+ '../../src/utils/fetchWrapper.js'
247+ ) ;
248+
247249 // First call should trigger dynamic import
248250 await getFetch ( ) ;
249251 // Note: Each function may call the dynamic import separately in the current implementation
250252 // This test verifies the behavior works correctly rather than enforcing specific internal implementation
251253 expect ( mockDynamicImportMain ) . toHaveBeenCalledWith ( 'node-fetch' ) ;
252-
254+
253255 // Subsequent calls should work correctly
254256 const fetchResult = await getFetch ( ) ;
255257 const requestResult = await getRequest ( ) ;
256258 const responseResult = await getResponse ( ) ;
257-
259+
258260 // Verify all functions return the expected mocked objects
259261 expect ( fetchResult ) . toBe ( mockNodeFetchMain . default ) ;
260262 expect ( requestResult ) . toBe ( mockNodeFetchMain . Request ) ;
0 commit comments