npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@contract-case/contract-case-jest

v0.28.0

Published

ContractCase contract testing suite

Readme

ContractCase Contract Testing Framework

Build and test Coverage Status Known Vulnerabilities

npm

Case

Briefcase sticker created by Gohsantosadrive on Flaticon

Read the documentation here.

ContractCase is a next-generation consumer-driven contract testing framework, building on many of the lessons from maintaining the excellent Pact contract testing framework. It is our belief that contract testing is the best way to get deployment confidence for your applications and services.

Feedback welcome on github!

Caveats and limitations

ContractCase is now available and should work for both client and server driven http/https contracts. Feedback on the ContractCase API / DSL and (especially) naming conventions very welcome. However, the following caveats should be kept in mind:

  1. ContractCase is currently only available in Javascript / Typescript and Java. At a later date, support for Python, C# and Go will be added. There are no plans to add other languages at this time.
  2. ContractCase doesn't currently support merging of contracts. This means that each contract must be defined in one test file (per contract).
  3. ContractCase currently is only compatible with Jest (js/ts) and JUnit (java).
  4. ContractCase currently only has minimal broker support. It supports the Pact broker, although the Pact broker isn't able to render ContractCase contracts in the UI.

Although the test coverage is high, and great care has been taken to ensure that the results are correct, there may still be bugs. Please open an issue if you experience any problems.

You can follow the detailed progress by reading the maintainer todo list. These caveats will be updated as progress is made.

I'm fine with all the caveats, how do I get started?

If you want to get started immediately, we recommend starting with the defining contracts documentation.

npm install --save-dev @contract-case/contract-case-jest

You may also need jest:

npm install --save-dev jest

For Pact users

ContractCase has a very similar philosophy to Pact, and to maximise Pact compatibility, ContractCase works with the Pact broker. We recommend either:

  • The Pact Broker for users wanting to host their own broke
  • The excellent Pactflow Broker for those needing SaaS and enterprise features

There are a few key differences - ContractCase is easier to extend, can express more complex contracts, and can define contracts at either the server side or the client side (although it is always consumer driven - your consumer just might be consuming requests). See for Pact users for more discussion.

Roadmap

  1. Pact Parity (complete)
  2. Server driven contracts (complete)
  3. Plugins and arbitrary extensions (complete)
  4. Support java (complete)
  5. Support function-based contracts (complete)
  6. Documentation (in progress)
  7. gRPC matchers
  8. Support Python, C# and Go
  9. Arbitrary combinations of request/response pairs, incidentally including native SQS support
  10. Pass-through APIs

For the gory details of the roadmap, you can see the implementation notebook / todo list here

Releases

ContractCase releases follow semantic versioning, with two additional restrictions:

  1. Before 1.0.0, ContractContractCase is in Beta, and the API is considered unstable. Breaking changes will be indicated in minor version bumps- that is, 0.2.0 and 0.3.0 are not entirely compatible.
  2. Before 1.0.0, patch versions will always be backwards compatible.

Breaking changes will always be detailed in the changelog.