Skip to content

Commit

Permalink
fix(verifier): added StateHandler type and improved JSDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyr-7D1h committed Jun 16, 2021
1 parent 0677f44 commit 4cad265
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/v3/verifier.ts
Expand Up @@ -5,6 +5,14 @@ import logger from '../common/logger';

import PactNative from '../../native/index.node';

/**
* Define needed state for given pacts
*/
export type StateHandler = (
setup: boolean,
parameters: Record<string, unknown>
) => void;

// Commented out fields highlight areas we need to look at for compatibility
// with existing API, as a sort of "TODO" list.
export interface VerifierV3Options {
Expand All @@ -18,14 +26,16 @@ export interface VerifierV3Options {
pactBrokerPassword?: string;
pactBrokerToken?: string;

// The timeout in milliseconds for request filters and provider state handlers
// to execute within
/**
* The timeout in milliseconds for request filters and provider state handlers
* to execute within
*/
callbackTimeout?: number;
// customProviderHeaders?: string[]
publishVerificationResult?: boolean;
providerVersion?: string;
requestFilter?: express.RequestHandler;
stateHandlers?: Record<string, () => void>;
stateHandlers?: Record<string, StateHandler>;

consumerVersionTags?: string | string[];
providerVersionTags?: string | string[];
Expand Down

0 comments on commit 4cad265

Please sign in to comment.