Skip to content

YOU54F/deno-pact

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Deno Pact

Try out Deno-Pact in your browser, via our interactive tutorial

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 get started

  • touch helloPactDeno.ts
import { DenoPact, Pact } from "https://deno.land/x/pact/src/mod.ts";
const denoPact = new DenoPact();
console.log(denoPact.getPactFfiVersion());
  • deno run -A --unstable helloPactDeno.ts

Egg Users

You can install via nest.land - Check the package for the latest version

import { DenoPact, Pact } from "https://x.nest.land/pact@0.0.6/src/mod.ts"

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