Skip to content

Commit

Permalink
Merge 3d6e2c2 into d2c5453
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Oct 10, 2019
2 parents d2c5453 + 3d6e2c2 commit 8e8805c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
27 changes: 4 additions & 23 deletions src/dsl/verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,16 @@ export interface StateHandler {
[name: string]: () => Promise<any>
}

// 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"
Expand Down Expand Up @@ -114,7 +95,7 @@ export class Verifier {
}`,
...omit(this.config, "handlers"),
providerBaseUrl: `${this.address}:${server.address().port}`,
} as PactNodeVerifierOptions
}

return qToPromise<any>(pact.verifyPacts(opts))
}
Expand Down

0 comments on commit 8e8805c

Please sign in to comment.