Urgent.News

What's breaking now, across thousands of outlets.

Tech

Pact vs Prism: Which Contract Mocking Tool Fits?

Quick answer: Pact and Prism are both used around contracts and mocks, but they start from opposite ends. Pact is consumer-driven: the consumer records the interactions it expects, and those are replayed against the provider in its pipeline to prove the two still agree. Prism is spec-driven: it reads an OpenAPI document and serves mock responses or validates traffic against that spec. Choose Pact…

Pact and Prism are contract mocking tools, but they serve different purposes. Pact is consumer-driven, meaning it focuses on the interactions expected by a consumer. It creates a contract based on what the consumer actually calls in a mock provider, and then verifies that the provider still meets those expectations before deployment. Prism, on the other hand, is spec-driven. It takes an existing OpenAPI document and uses it to generate mock responses or validate live traffic against the specification.

Choosing between the two depends on where your "contract" lives. If your source of truth is the consumer's interactions, Pact is the better fit. If the OpenAPI document is your reference, Prism offers a lighter solution. Both tools can coexist - a team could use Prism for local development and consumer-driven contracts in CI for services that truly need integration guarantees. However, neither tool can replace real end-to-end testing or guarantee correctness outside the scope of what they cover.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Out of scope needs a trigger

People early in their careers usually get scope wrong in one of two ways: they solve more than was asked without saying so, or they leave something out without saying so.

  • Out of scope elements must be clearly identified
  • Document timing for reintroduction of omitted components
  • Specifying when resolves scope creep into manageable decisions

Making three.js bricks look like real LEGO: studio light, hollow undersides and a real wooden table

The first 3D viewer on Mister Blocks drew bricks as coloured boxes with little cylinders on top. It was technically correct and looked like a spreadsheet.

  • Use studio lighting with softbox and side strip lights for realistic sheen and highlights
  • Place model on real wooden table to enhance tangibility and avoid blue void
  • Optimize geometry by sharing same pieces, computing outlines once per size

More from Thursday 12 November →