11import type { PublishOptions } from '../src/types'
22import { describe , expect , it , vi } from 'vitest'
33import { DEFAULT_PUBLISH_OPTIONS } from '../src/constants'
4- import { executeWithFeedback } from '../src/utils'
4+ import { runWithRetry } from '../src/utils'
55
66const publisOptions : PublishOptions = {
77 ...DEFAULT_PUBLISH_OPTIONS ,
@@ -17,11 +17,11 @@ const publisOptions: PublishOptions = {
1717 ovsxPat : 'ovsx-pat' ,
1818}
1919
20- describe ( 'executeWithFeedback ' , ( ) => {
20+ describe ( 'runWithRetry ' , ( ) => {
2121 it ( 'should execute function successfully' , async ( ) => {
2222 const mockFn = vi . fn ( ) . mockResolvedValue ( undefined )
2323
24- const result = await executeWithFeedback ( {
24+ const result = await runWithRetry ( {
2525 config : publisOptions ,
2626 message : 'Testing...' ,
2727 successMessage : 'Success!' ,
@@ -37,7 +37,7 @@ describe('executeWithFeedback', () => {
3737 const mockFn = vi . fn ( )
3838 const mockDryFn = vi . fn ( ) . mockResolvedValue ( undefined )
3939
40- const result = await executeWithFeedback ( {
40+ const result = await runWithRetry ( {
4141 config : { ...publisOptions , dry : true } ,
4242 message : 'Testing...' ,
4343 successMessage : 'Dry Run Success!' ,
@@ -57,7 +57,7 @@ describe('executeWithFeedback', () => {
5757 . mockRejectedValueOnce ( new Error ( 'Second failure' ) )
5858 . mockResolvedValueOnce ( undefined )
5959
60- const result = await executeWithFeedback ( {
60+ const result = await runWithRetry ( {
6161 config : { ...publisOptions , retry : 2 , retryDelay : 10 } ,
6262 message : 'Testing...' ,
6363 successMessage : 'Success!' ,
@@ -75,7 +75,7 @@ describe('executeWithFeedback', () => {
7575 . mockRejectedValueOnce ( new Error ( 'Second failure' ) )
7676 . mockRejectedValueOnce ( new Error ( 'Third failure' ) )
7777
78- const result = await executeWithFeedback ( {
78+ const result = await runWithRetry ( {
7979 config : { ...publisOptions , retry : 2 , retryDelay : 10 } ,
8080 message : 'Testing...' ,
8181 successMessage : 'Success!' ,
@@ -90,7 +90,7 @@ describe('executeWithFeedback', () => {
9090 it ( 'should not retry when retryCount is not provided' , async ( ) => {
9191 const mockFn = vi . fn ( ) . mockRejectedValue ( new Error ( 'Error' ) )
9292
93- const result = await executeWithFeedback ( {
93+ const result = await runWithRetry ( {
9494 config : { ...publisOptions , retry : 0 } ,
9595 message : 'Testing...' ,
9696 successMessage : 'Success!' ,
0 commit comments