import { MessageConsumerOptions , PactOptions , } from '@pact-foundation/pact/dsl/options' ; import { ConsumerOptions , WrapperFn , WrapperWithOnlyAndSkip } from './types' ; const describeString = ( options ) => `Pact between ${ options . consumer } and ${ options . provider }` ; const describePactWith = < O extends ConsumerOptions , P , W extends WrapperFn < O , P > > ( describeFn , wrapper ) => ( options , tests ) => describeFn ( describeString ( options ) , ( ) => wrapper ( options , tests ) ) ; export const extendPactWith = < O extends ConsumerOptions , P , W extends WrapperFn < O , P > > ( wrapper ) => { const ret = describePactWith < O , P , W > ( describe , wrapper ) as WrapperWithOnlyAndSkip < O , P > ; ret . only = describePactWith < O , P , W > ( describe . only , wrapper ) ; ret . skip = describePactWith < O , P , W > ( describe . skip , wrapper ) ; return ret ; } ;