Skip to content

Commit 99b3e88

Browse files
committed
add typof test
1 parent 4597ec5 commit 99b3e88

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/plugin/retryFailedStep.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ export default function (config) {
128128
return
129129
}
130130

131-
const scenarioRetries = test.retries()
131+
// Check if test.retries is a function (may not exist in all contexts)
132+
const scenarioRetries = typeof test.retries === 'function' ? test.retries() : -1
132133
const stepRetryPriority = RETRY_PRIORITIES.STEP_PLUGIN
133134
const scenarioPriority = test.opts.retryPriority || 0
134135

@@ -159,7 +160,8 @@ export default function (config) {
159160
const hasManualRetries = recorder.retries.some(retry => retry !== config)
160161
if (hasManualRetries) return
161162

162-
const scenarioRetries = test.retries()
163+
// Check if test.retries is a function
164+
const scenarioRetries = typeof test.retries === 'function' ? test.retries() : -1
163165
if (scenarioRetries > 0 && config.deferToScenarioRetries !== false) {
164166
return
165167
}

0 commit comments

Comments
 (0)