@@ -297,8 +297,10 @@ describe('buildFunctionExtension', () => {
297297
298298 test ( 'cleans up stale lock before acquiring new lock' , async ( ) => {
299299 // Given
300- vi . mocked ( fileExists ) . mockResolvedValue ( true ) // Lock file exists
301- vi . mocked ( lockfile . check ) . mockResolvedValue ( false ) // Lock is stale (not actively held)
300+ // Lock file exists
301+ vi . mocked ( fileExists ) . mockResolvedValue ( true )
302+ // Lock is stale (not actively held)
303+ vi . mocked ( lockfile . check ) . mockResolvedValue ( false )
302304 vi . mocked ( rmdir ) . mockResolvedValue ( )
303305
304306 // When
@@ -321,8 +323,10 @@ describe('buildFunctionExtension', () => {
321323
322324 test ( 'does not clean up lock that is actively held' , async ( ) => {
323325 // Given
324- vi . mocked ( fileExists ) . mockResolvedValue ( true ) // Lock file exists
325- vi . mocked ( lockfile . check ) . mockResolvedValue ( true ) // Lock is active (held by another process)
326+ // Lock file exists
327+ vi . mocked ( fileExists ) . mockResolvedValue ( true )
328+ // Lock is active (held by another process)
329+ vi . mocked ( lockfile . check ) . mockResolvedValue ( true )
326330 vi . mocked ( rmdir ) . mockResolvedValue ( )
327331
328332 // When
@@ -338,14 +342,16 @@ describe('buildFunctionExtension', () => {
338342
339343 // Then
340344 expect ( lockfile . check ) . toHaveBeenCalled ( )
341- expect ( rmdir ) . not . toHaveBeenCalled ( ) // Should not remove active lock
345+ // Should not remove active lock
346+ expect ( rmdir ) . not . toHaveBeenCalled ( )
342347 expect ( lockfile . lock ) . toHaveBeenCalled ( )
343348 expect ( releaseLock ) . toHaveBeenCalled ( )
344349 } )
345350
346351 test ( 'cleans up corrupted lock when check fails' , async ( ) => {
347352 // Given
348- vi . mocked ( fileExists ) . mockResolvedValue ( true ) // Lock file exists
353+ // Lock file exists
354+ vi . mocked ( fileExists ) . mockResolvedValue ( true )
349355 vi . mocked ( lockfile . check ) . mockRejectedValue ( new Error ( 'ENOENT or corrupted lock' ) )
350356 vi . mocked ( rmdir ) . mockResolvedValue ( )
351357
@@ -369,7 +375,8 @@ describe('buildFunctionExtension', () => {
369375
370376 test ( 'proceeds normally when no stale lock exists' , async ( ) => {
371377 // Given
372- vi . mocked ( fileExists ) . mockResolvedValue ( false ) // No lock file exists
378+ // No lock file exists
379+ vi . mocked ( fileExists ) . mockResolvedValue ( false )
373380
374381 // When
375382 await expect (
@@ -383,7 +390,8 @@ describe('buildFunctionExtension', () => {
383390 ) . resolves . toBeUndefined ( )
384391
385392 // Then
386- expect ( lockfile . check ) . not . toHaveBeenCalled ( ) // Should not check if file doesn't exist
393+ // Should not check if file doesn't exist
394+ expect ( lockfile . check ) . not . toHaveBeenCalled ( )
387395 expect ( rmdir ) . not . toHaveBeenCalled ( )
388396 expect ( lockfile . lock ) . toHaveBeenCalled ( )
389397 expect ( releaseLock ) . toHaveBeenCalled ( )
0 commit comments