User Tools

Site Tools


pact_contract_test

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pact_contract_test [2026/01/05 08:18] โ€“ [Overview] pradnyapact_contract_test [2026/01/05 08:27] (current) โ€“ [Overview] pradnya
Line 80: Line 80:
 </code> </code>
  
-Helper Setup File+**Helper Setup File**
  
 <code> <code>
Line 86: Line 86:
  
 </code> </code>
 +
 +Create pact
  <font 9px/inherit;;inherit;;inherit>ts</font>  <font 9px/inherit;;inherit;;inherit>ts</font>
 +
 +<code>
 +import path from "path";
 +import { PactV3 } from "@pact-foundation/pact";
 +
 +export function createPact(providerName: string) {
 +  return new PactV3({
 +    consumer: "BFF-Service",
 +    provider: providerName,
 +    dir: path.resolve(process.cwd(), "pacts"),
 +    logLevel: "INFO"
 +  });
 +}
 +
 +</code>
 +
 +**login.pact.test.ts** <font 9px/inherit;;inherit;;inherit>ts</font>
  
 <code> <code>
Line 134: Line 153:
  
  
 +
 +
 +====== Generated Pact Files ======
 +
 +Pacts output to:
 +
 +<code>
 +/pacts
 + โ”— BFF-Service-Auth-Service.json
 +
 +</code>
  
  
pact_contract_test.1767601124.txt.gz ยท Last modified: by pradnya