{"id":18583522,"url":"https://github.com/maxdome/dumpinator","last_synced_at":"2025-04-10T11:37:10.511Z","repository":{"id":57217147,"uuid":"73828363","full_name":"maxdome/dumpinator","owner":"maxdome","description":"Refactor and test your REST API with confidence. With Dumpinator™.","archived":false,"fork":false,"pushed_at":"2017-04-20T18:06:49.000Z","size":177,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-03-24T21:21:47.480Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxdome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-15T15:40:30.000Z","updated_at":"2021-12-21T22:59:49.000Z","dependencies_parsed_at":"2022-08-28T21:40:20.365Z","dependency_job_id":null,"html_url":"https://github.com/maxdome/dumpinator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdome%2Fdumpinator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdome%2Fdumpinator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdome%2Fdumpinator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdome%2Fdumpinator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxdome","download_url":"https://codeload.github.com/maxdome/dumpinator/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248151634,"owners_count":21056142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T00:23:22.207Z","updated_at":"2025-04-10T11:37:05.495Z","avatar_url":"https://github.com/maxdome.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n   ____                        _             _\n  |  _ \\ _   _ _ __ ___  _ __ (_)_ __   __ _| |_ ___  _ __  TM\n  | | | | | | | '_ ` _ \\| '_ \\| | '_ \\ / _` | __/ _ \\| '__|\n  | |_| | |_| | | | | | | |_) | | | | | (_| | || (_) | |\n  |____/ \\__,_|_| |_| |_| .__/|_|_| |_|\\__,_|\\__\\___/|_|\n                        |_|\n```\n[![Travis Build Status](https://travis-ci.org/maxdome/dumpinator.svg?branch=develop)](https://travis-ci.org/maxdome/dumpinator)\n\nDumpinator is an automated QA tool for REST APIs. Its mission is to compare a list of HTTP Response Headers \u0026 Bodies in different environments \u0026 versions. The current version was developed as a development tool that quickly generates API response diffs that give an idea whether major refactorings work as expected. The goal is to develop Dumpinator as an independent, scriptable CLI tool that can be used for all sorts of REST APIs. It expects a main configuration file and spec files for each API endpoint that needs to be diff'ed. Each run writes the responses as JSON files in the given directory and outputs an easy-to-read HTML report of the diff. Used in combination with Jenkins, Dumpinator can be run in a CI pipeline but also be triggered manually by the QA team each time a new API release is about to be deployed as a replacement for tedious and time consuming regression tests.\n\n\u003e \"With Dumpinator™, we are about to revolutionize the way we think about Heimdall testing and API testing in general.\"\n\n_A. Heinkelein, CEO Heimdall Inc._\n\n# Installation\n\nInstall Dumpinator™ globally using\n\n    $ npm install -g dumpinator\n\n\n# Using the CLI\n\n    Synopsis: dp [options] [command]\n\n    Commands:\n\n      diff \u003cleft\u003e \u003cright\u003e  compare the given routes\n      diff \u003cid\u003e            compare the given routes by a result id\n      show \u003cid\u003e            show a result of the given id\n      run                  run the diff suite (default task)\n      help [cmd]           display help for [cmd]\n\n    Options:\n\n      -h, --help     output usage information\n      -V, --version  output the version number\n      -v, --verbose  Be more verbose\n\n## `run` Command\n\nCan be used both with **config files** and **command line arguments**. Fetches the given routes and outputs a **run report** by comparing each left \u0026 right side response.\nThe `run` task is the default task an will be used if no task was added to the command.\n\n    $ dp [options]\n\nis the same as\n\n    $ dp run [options]\n\n### Using the default config\n\nIf no arguments are given, Dumpinator™ tries to find the default config in the current working directory. If `dumpinator.conf.js` is not found, it looks for `dumpinator.json` (CommonJS module) before giving up:\n\n    $ dp run\n\n### Using a custom config\n\nA custom config can be provided via `-c` or `--config`:\n\n    $ dp run -c /path/to/my/config.json  # or config.js (CommonJS module)\n\n### Provding 2 routes directly (defaults to GET method)\n\n    $ dp run http://localhost/v2/my-first-route http://myapi.com/v1/my-first-route\n\n### Provding 2 routes directly with custom methods\n\n    $ dp run \"POST http://localhost/v2/my-first-route\" \"POST http://myapi.com/v1/my-first-route\"\n\n### Adding custom headers to both sides\n\n    $ dp run \u003cleft\u003e \u003cright\u003e -H \"content-type:application/json\" -H \"language:en_US\"  # or --header \"...\"\n\n### Adding custom headers to left side only\n\n    $ dp run \u003cleft\u003e \u003cright\u003e -L \"content-type:application/json\" -L \"language:en_US\"  # or --header-left \"...\"\n\n### Adding custom headers to both sides\n\n    $ dp run \u003cleft\u003e \u003cright\u003e -R \"content-type:application/json\" -R \"language:en_US\"  # or --header-right \"...\"\n\n### Overriding the concurrency rate limit\n\n    $ dp run -r 10  # or --rate ...\n\n### Only include routes with a tag\n\n    $ dp run -t \"some-route-type\"  # or --tag \"...\"\n\n\n## `diff` Command\n\nThis command shows a diff of two given routes or a result id. It's ok to use only the first characters as long as a unique match is found.\n\n    $ dp diff http://foo.com/my.json http://bar.com/my.json\n\nor\n\n    $ dp diff fe345dc  # or dp diff fe\n\n\n# Config Files\n\nDumpinator™ accepts both **JSON** files and **CommonJS** modules which can be scripted for more flexibility.\n\n## Basic example\n\nThe following config will fetch 2 routes `/my-first-route` and `/my-second-route` from both `http://localhost/v2/` and `http://myapi.com/v1/` and compare them.\n\n### CommonJS\n\n```javascript\nmodule.exports = {\n  defaults: {\n    left: {\n      hostname: 'http://localhost/v2/'\n    },\n    right: {\n      hostname: 'http://myapi.com/v1/'\n    }\n  },\n  routes: [\n    {\n      url: '/my-first-route'\n    },\n    {\n      url: '/my-second-route'\n    }\n  ]\n};\n```\n\n### JSON\n\n```json\n{\n  \"defaults\": {\n    \"left\": {\n      \"hostname\": \"http://localhost/v2/\"\n    },\n    \"right\": {\n      \"hostname\": \"http://myapi.com/v1/\"\n    }\n  },\n  \"routes\": [\n    {\n      \"url\": \"/my-first-route\"\n    },\n    {\n      \"url\": \"/my-second-route\"\n    }\n  ]\n}\n```\n\n## Adding default headers\n\nAdditional headers can be added to the `defaults.left` and `defaults.right` sections where they get appended to each route:\n\n### CommonJS\n\n```javascript\nmodule.exports = {\n  defaults: {\n    left: {\n      hostname: 'http://localhost/v2/',\n      header: {\n        'content-type': 'application/json',\n        // ...\n      }\n    },\n    right: {\n      hostname: 'http://myapi.com/v1/',\n      header: {\n        'content-type': 'application/json',\n        'x-some-additional-header': 'that-is-only-relevant-on-this-host',\n        // ...\n      }\n    }\n  },\n  routes: [\n    // ...\n  ]\n};\n```\n\n### JSON\n\n```json\n{\n  \"defaults\": {\n    \"left\": {\n      \"hostname\": \"http://localhost/v2/\",\n      \"header\": {\n        \"content-type\": \"application/json\",\n        ...\n      }\n    },\n    \"right\": {\n      \"hostname\": \"http://myapi.com/v1/\",\n      \"header\": {\n        \"content-type\": \"application/json\",\n        \"x-some-additional-header\": \"that-is-only-relevant-on-this-host\",\n        ...\n      }\n    }\n  },\n  \"routes\": [\n    ...\n  ]\n}\n```\n\n## Adding headers per route\n\nHeaders can be added to each route individually, extending \u0026 overriding default headers:\n\n### CommonJS\n\n```javascript\nmodule.exports = {\n  defaults: {\n    // ...\n  },\n  routes: [\n    {\n      url: '/my-first-route',\n      header: {\n        'content-type': 'application/json',\n        // ...\n      }\n    },\n    // ...\n  ]\n};\n```\n\n### JSON\n\n```json\n{\n  \"defaults\": {\n    ...\n  },\n  \"routes\": [\n    {\n      \"url\": \"/my-first-route\",\n      \"header\": {\n        \"content-type\": \"application/json\",\n        ...\n      }\n    },\n    ...\n  ]\n}\n```\n\n\n## Adding default query parameters\n\nAdditional query parameters can be added to the `defaults.left` and `defaults.right` sections where they get appended to each route:\n\n### CommonJS\n\n```javascript\nmodule.exports = {\n  defaults: {\n    left: {\n      hostname: 'http://localhost/v2/',\n      query: {\n        defaultQuery: 'defaultValue',\n        // ...\n      }\n    },\n    right: {\n      hostname: 'http://myapi.com/v1/',\n      query: {\n        defaultQuery: 'defaultValue',\n        additionalQuery: 'thatIsOnlyRelevantOnThisHost',\n        // ...\n      }\n    }\n  },\n  routes: [\n    // ...\n  ]\n};\n```\n\n### JSON\n\n```json\n{\n  \"defaults\": {\n    \"left\": {\n      \"hostname\": \"http://localhost/v2/\",\n      \"query\": {\n        \"defaultQuery\": \"defaultValue\",\n        ...\n      }\n    },\n    \"right\": {\n      \"hostname\": \"http://myapi.com/v1/\",\n      \"query\": {\n        \"defaultQuery\": \"defaultValue\",\n        \"additionalQuery\": \"thatIsOnlyRelevantOnThisHost\",\n        ...\n      }\n    }\n  },\n  \"routes\": [\n    ...\n  ]\n}\n```\n\n\n## Adding query parameters per route\n\nQuery parameters can be added to each route individually, extending \u0026 overriding default query parameters:\n\n### CommonJS\n\n```javascript\nmodule.exports = {\n  defaults: {\n    // ...\n  },\n  routes: [\n    {\n      url: '/my-first-route',\n      query: {\n        defaultQuery: 'defaultValue',\n        // ...\n      }\n    },\n    // ...\n  ]\n};\n```\n\n### JSON\n\n```json\n{\n  \"defaults\": {\n    ...\n  },\n  \"routes\": [\n    {\n      \"url\": \"/my-first-route\",\n      \"query\": {\n        \"defaultQuery\": \"defaultValue\",\n        ...\n      }\n    },\n    ...\n  ]\n}\n```\n\n### Options\n\n#### Status\n\nSetting the `status` option makes a route test fail if the status code doesn't match.\n\n```json\n{\n  \"defaults\": {\n    ...\n  },\n  \"routes\": [\n    {\n      \"url\": \"/my-first-route\",\n      \"status\": 204\n    },\n    ...\n  ]\n}\n```\n\n#### Method\n\nThe `method` option sets the HTTP send method which can be set in either level. `GET` is the default.  \n\nDumpinator supports these methods:  \n\n`CHECKOUT` `COPY` `DELETE` `GET` `HEAD` `LOCK` `MERGE` `MKACTIVITY` `MKCOL` `MOVE` `M-SEARCH` `NOTIFY` `OPTIONS` `PATCH` `POST` `PURGE` `PUT` `REPORT` `SEARCH` `SUBSCRIBE` `TRACE` `UNLOCK` `UNSUBSCRIBE`\n\n```json\n{\n  \"defaults\": {\n    \"method\": \"GET\",\n    ...\n  },\n  \"routes\": [\n    {\n      \"url\": \"/my-first-route\",\n      \"status\": 204,\n      \"right\": {\n        \"method\": \"POST\"\n      }\n    },\n    ...\n  ]\n}\n```\n\n#### Callbacks\n\nCallbacks can be used as hooks on any level to add some before/after logic.\n\n`before` on base level: Called before starting all tests\n`beforeEach` on base level: Called before each route\n`before` on route level: Called before a single route\n`after` on route level: Called after a single route\n`afterEach` on base level: Called after each route\n`after` on base level: Called after completing all tests\n\nCallbacks are simple functions and either sync or async. If you return a promise, the callback will be handled async, otherwise sync.\n\n```javascript\nmodule.exports = {\n  defaults: {\n    // ...\n  },\n  before: () =\u003e {\n    console.log('All tests started');\n    return Promise.resolve();\n  },\n  beforeEach: () =\u003e {\n    console.log('Route started');\n  },\n  after: () =\u003e {\n    console.log('All tests completed');\n  }\n  routes: [\n    {\n      url: '/my-first-route',\n      before: () =\u003e {\n        console.log('Individual route started');\n        return Promise.resolve();\n      },\n      after: () =\u003e {\n        console.log('Individual route completed');\n        return Promise.resolve();\n      }\n    },\n    // ...\n  ]\n};\n```\n\n#### Transformations\n\nA `transform()` method can be used to transform the response before it gets stored or used for a diff. The transform method is a static method and contains the response object as first argument.\n\n```js\nmodule.exports = {\n  defaults: {\n    // ...\n  },\n  routes: [\n    {\n      url: '/my-first-route',\n      left: {\n        tranform(res) {\n          // wrap a data level around body response\n          res.body = JSON.stringify({ data: JSON.parse(res.body) });\n          return res;\n        }\n      }\n    },\n    // ...\n  ]\n};\n```\n\n#### Ignoring properties\n\nSometimes, you don't care about certain header or body properties and want to ignore them. Use `ignoreHeader` and `ignoreBody` for that.\n\n```json\n{\n  \"defaults\": {\n    \"ignoreBody\": [\n      \"foo.bar\",\n      \"customer.sessionId\"\n    ],\n    \"ignoreHeader\": [\n      \"sessionid\",\n      \"cookies\"\n    ]\n  },\n  \"routes\": [\n    {\n      \"url\": \"/my-first-route\",\n      \"query\": {\n        \"defaultQuery\": \"defaultValue\",\n        ...\n      }\n    },\n    ...\n  ]\n}\n```\n\n\n# Using the API\n\nThe API can be used directly, too.\n\n```javascript\nconst dumpinator = require('dumpinator');\n// TODO\n```\n\n## Methods\n\nTODO\n\n\n# License\n\nCopyright \u0026copy; 2016 [maxdome GmbH](https://github.com/maxdome)\n\nLicensed under the [MIT license](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxdome%2Fdumpinator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxdome%2Fdumpinator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxdome%2Fdumpinator/lists"}