Initial public release of Apophis — invariant-driven automated API testing
This commit is contained in:
@@ -29,7 +29,6 @@ export interface OutboundMockRuntime {
|
||||
interface OutboundMockOptions {
|
||||
readonly contracts: ResolvedOutboundContract[]
|
||||
readonly mode: 'example' | 'property'
|
||||
readonly generationProfile?: 'quick' | 'standard' | 'thorough'
|
||||
readonly overrides?: Record<string, {
|
||||
readonly forceStatus?: number
|
||||
readonly headers?: Record<string, string>
|
||||
@@ -77,7 +76,7 @@ export function createOutboundMockRuntime(opts: OutboundMockOptions): OutboundMo
|
||||
const schema = contract.response[statusCode]
|
||||
if (!schema) return null
|
||||
// Generate base response from schema
|
||||
const arb = convertSchema(schema, { context: 'response', generationProfile: opts.generationProfile })
|
||||
const arb = convertSchema(schema, { context: 'response' })
|
||||
const samples = fc.sample(arb, { numRuns: 1, seed: opts.seed + calls.length })
|
||||
let body = samples[0] ?? null
|
||||
if (typeof body !== 'object' || body === null) return body
|
||||
|
||||
Reference in New Issue
Block a user