Declarative snapshot & reconciliation testing

Snapline compares APIs, databases, and JSON fixtures as data — not imperative assertion chains. Configure what should match, how to normalize volatile fields, and how to map codes across systems in one object.

Node.js 18+ REST · GraphQL · SOAP SQL · NoSQL · Queues Kafka (optional) MIT License
Built by VaagaTech

Snapline is an open-source integration testing framework from VaagaTech (www.vaagatech.com) — declarative test automation for APIs, databases, and JSON fixtures.

Purpose

Integration tests often devolve into dozens of brittle field assertions that break when schemas evolve. Snapline flips the model: you declare a golden snapshot and reconciliation rules, and the framework handles HTTP, auth, fetching rows, deep comparison, and structured diffs.

API ↔ file

Call REST, GraphQL, or SOAP and compare the response to a JSON fixture after normalization.

DB ↔ DB

Query two databases (same or different SQL) and compare rows — including NoSQL document stores.

API ↔ DB

Verify an API response matches a database row, or drive an API call from a DB row.

Fixture cases

Run many pass/fail scenarios from a fixtures/cases/ directory with minimal per-case JSON.

Queue → poll

Publish to Kafka or a message queue, then poll SQL or the filesystem for async results.

Why Snapline?

Traditional tests look like this:

expect(response.status).toBe(200);
expect(response.body.email).toBe('alice@example.com');
expect(response.body.status).toBe('synced');
expect(response.body.currentdate).toMatch(/^\d{4}-\d{2}-\d{2}/);

With Snapline:

const result = await testSuite('User sync', {
  baseUrl: process.env.API_BASE_URL,
  api: {
    endpoint: '/api/v1/user/sync',
    method: 'POST',
    inputFile: './fixtures/input.json',
    expectedFile: './fixtures/expected.json',
    ignoreFields: ['pincode'],
    transformations: {
      currentdate: (v) => isValidDate(v) ? 'VALID_DATE' : 'INVALID_DATE',
    },
  },
});
process.exitCode = result.passed ? 0 : 1;

Install

npm install @vaagatech/snapline-core

# Optional — messaging queues (Kafka, in-memory):
npm install @vaagatech/snapline-messaging-adapters

One package re-exports the engine, API adapters, auth adapters, fixture runners, and reporting. SQL uses the DbConnectionLike contract (bring your own driver). Queues use @vaagatech/snapline-messaging-adapters with publishAndPoll. See Getting Started for a 5-minute walkthrough.

Reconciliation pipeline

Every comparison runs the same pipeline on the live side before deep compare:

live data │ ├─ ignoreFields strip volatile fields (dot paths supported) ├─ transformations normalize dynamic values (dates, enums, etc.) ├─ dataMapping map equivalent codes across systems └─ deep compare structured diff with field paths
Next steps: Read Architecture for package layout, End-to-End Guide for a complete workflow from fixtures to CI reports, and Demo Scenarios for 21 runnable examples in this repo. For a centralized test results dashboard, see optional Snapline Hub.