Skip to main content

Deno Pact

Pre-Reqs

You need to Download the Pact FFI Library for your platform

OS Architecture Supported
OSX x86_64 βœ…
OSX arm βœ…
Linux x86_64 βœ…
Linux arm βœ…
Windows x86_64 βœ…
deno run -A --unstable https://deno.land/x/pact/src/downloadFfi.ts --run
  • Checks if it exists in ${HOME}/.pact/ffi/<pact_ffi_version>
  • Downloads the necessary library for your architecture
  • Executes the library to ensure it works

You can also do this in code

import { downloadFfiForPlatform } from "https://deno.land/x/pact/src/mod.ts";
await downloadFfiForPlatform()

How to use

import { DenoPact, Pact } from "https://deno.land/x/pact/src/mod.ts";
const denoPact = new DenoPact();

Examples

There is a handy helper script to run the examples

Try ./run help for available commands or take a look at the run script

gRPC Area Calculator

gRPC Greeter

HTTP service - Swagger Mock Validator

Pact Verifications

Docker

You can spin up various services with Docker to help you play around with the pact files generated, and the examples