diff --git a/package.json b/package.json index ffaaf4938..ab58ea438 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ }, "homepage": "http://docs.pact.io/documentation/javascript.html", "dependencies": { - "@pact-foundation/pact-node": "^9.0.3", + "@pact-foundation/pact-node": "^9.0.4", "@types/bluebird": "^3.5.20", "@types/bunyan": "^1.8.3", "@types/express": "^4.11.1", diff --git a/src/dsl/verifier.ts b/src/dsl/verifier.ts index 32d98b8c0..3ad6a2c82 100644 --- a/src/dsl/verifier.ts +++ b/src/dsl/verifier.ts @@ -25,35 +25,16 @@ export interface StateHandler { [name: string]: () => Promise } -// See https://stackoverflow.com/questions/43357734/typescript-recursive-type-with-indexer/43359686 -// as to why we can't use an intersection type here -// TL;DR - PactNodeVerifierOptions has an index type which enforces all keys to match the index type -export interface VerifierOptions { +interface ProxyOptions { logLevel?: LogLevel requestFilter?: express.RequestHandler stateHandlers?: StateHandler - providerBaseUrl: string - provider?: string - pactUrls?: string[] - pactBrokerBaseUrl?: string - providerStatesSetupUrl?: string - pactBrokerUsername?: string - pactBrokerPassword?: string - pactBrokerToken?: string - consumerVersionTag?: string | string[] - customProviderHeaders?: string[] - publishVerificationResult?: boolean - providerVersion?: string - pactBrokerUrl?: string - tags?: string[] - timeout?: number - monkeypatch?: string - format?: "json" | "RspecJunitFormatter" - out?: string validateSSL?: boolean changeOrigin?: boolean } +export type VerifierOptions = ProxyOptions & PactNodeVerifierOptions + export class Verifier { private address: string = "http://localhost" private stateSetupPath: string = "/_pactSetup" @@ -114,7 +95,7 @@ export class Verifier { }`, ...omit(this.config, "handlers"), providerBaseUrl: `${this.address}:${server.address().port}`, - } as PactNodeVerifierOptions + } return qToPromise(pact.verifyPacts(opts)) }