Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// process request separately since its unique
const processedErrors = processValidationResult(rawValidationResult)
if (processedErrors.requestValidationResult.errors === undefined) {
throw new Error("ICE: processedErrors.requestValidationResult.errors === undefined")
}
const modelErrors = !request.isValid
? toModelErrors(
processedErrors.requestValidationResult.errors,
operationId,
scenarioName,
ValidationResultSource.REQUEST,
"ALL"
)
: it.empty()
// process responses
rawValidationResult.requestValidationResult.errors = []
const entries = sm.entries(scenario.responses)
const invalidResponses = entries.filter(entry => {
const [, response] = entry
return !response.isValid
})
const result = invalidResponses.flatMap(response => {
const [responseCode] = response
return responseReducer(responseCode, scenario, rawValidationResult, operationId, scenarioName)
})
return modelErrors.concat(result)
}