{"id":31897304,"url":"https://github.com/johnnynotsolucky/upssert","last_synced_at":"2025-10-13T11:19:23.446Z","repository":{"id":57387365,"uuid":"73743402","full_name":"johnnynotsolucky/upssert","owner":"johnnynotsolucky","description":"Simple REST API assertion framework","archived":false,"fork":false,"pushed_at":"2017-02-10T20:46:41.000Z","size":388,"stargazers_count":13,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-02T14:24:51.206Z","etag":null,"topics":["assertions","rest-api","testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnnynotsolucky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-14T20:17:11.000Z","updated_at":"2023-09-22T18:59:33.000Z","dependencies_parsed_at":"2022-09-07T14:51:34.994Z","dependency_job_id":null,"html_url":"https://github.com/johnnynotsolucky/upssert","commit_stats":null,"previous_names":["upssert/upssert"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/johnnynotsolucky/upssert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnynotsolucky%2Fupssert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnynotsolucky%2Fupssert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnynotsolucky%2Fupssert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnynotsolucky%2Fupssert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnnynotsolucky","download_url":"https://codeload.github.com/johnnynotsolucky/upssert/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnynotsolucky%2Fupssert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014766,"owners_count":26085593,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["assertions","rest-api","testing"],"created_at":"2025-10-13T11:19:21.031Z","updated_at":"2025-10-13T11:19:23.436Z","avatar_url":"https://github.com/johnnynotsolucky.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr\u003e\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://cdn.rawgit.com/upssert/upssert/master/media/arvakr.svg\"\n    style=\"background: transparent; width: 200px; height: 200px;\"\n    alt=\"Upssert REST API assertion framework\"/\u003e\n\u003c/p\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n# Upssert\n\n[![Build Status](https://travis-ci.org/upssert/upssert.svg?branch=master)](https://travis-ci.org/upssert/upssert)\n[![Coverage Status](https://coveralls.io/repos/github/upssert/upssert/badge.svg)](https://coveralls.io/github/upssert/upssert)\n[![Dependencies](https://david-dm.org/upssert/upssert.svg)](https://david-dm.org/upssert/upssert)\n\nUpssert is an extremely simple REST API assertion framework which makes it easier to monitor and test your API.\nWithout writing any code, test your API against its responsiveness and any combination of parameters.\n\n## Principles\n\n - Zero configuration setup\n - Human-readable test suite definitions\n - Repeatable across environments\n - Assert anything\n - Stay easy\n\n## Installation\n\n    npm install upssert\n\n## Usage\n\n    $ upssert --url http://httpbin.org/get\n\n    Executing 1 test suites (2 assertions)…\n\n    Ping\n      ✓ http://httpbin.org/get\n\n    1 passing (204.000ms)\n\n\nBy default Upssert will assert that a URL's response code is within the 200 or 300 range, i.e.\n\n    $ node ./dist/bin/index.js --url https://httpbin.org/status/404\n\n    Executing 1 test suites (2 assertions)…\n\n    Ping\n      ✖ https://httpbin.org/status/404\n\n    1) https://httpbin.org/status/404\n    Error: expected 404 to be below 400 (statusCode)\n\n    0 passing (418.000ms)\n    1 failing\n\n### Assertions\n\nUnder the hood, Upssert uses [Chai Assertion Library's](http://chaijs.com/) [`assert`](http://chaijs.com/api/assert/) API\nfor its assertions. All the assertions exposed by Chai are available in Upssert with the exception of:\n\n - `assert(expression, message)`\n - `throws`\n - `doesNotThrow`\n - `changes`\n - `doesNotChange`\n - `increases`\n - `doesNotIncrease`\n - `decreases`\n - `doesNotDecrease`\n\nThe following will be supported in the future\n\n - `operater`\n - `closeTo`\n - `approximately`\n\n### CLI\n\n#### Options\n\n - `url` Supply Upssert with a URL to run a ping assertion against\n - `reporter` Tell Upssert which reporter to use. Options are `tap` and `console`. Defaults to `console`\n\nIf neither a glob pattern or `--url` flag is supplied, Upssert will look in `test/api/**/*.json` for test suites.\nAlternatively, Upssert can be configured within `package.json` with the following options:\n\n    {\n      ...\n      \"upssert\": {\n        \"globOpts\": {},\n        \"testDir\": \"path/to/your/tests/**/*.json\"\n      }\n    }\n\n`globOpts` can be configured as defined in [https://github.com/isaacs/node-glob]()\n\n#### Running Test Suites\n\nTest suites are defined as JSON files\n\n    $ cat \u003c\u003c EOF \u003e ping.json\n    {\n      \"name\": \"Ping httpbin.org\",\n      \"tests\": [\n        {\n          \"name\": \"Successfully pings httpbin.org\",\n          \"request\": {\n            \"url\": \"https://httpbin.org\",\n            \"method\": \"GET\"\n          }\n        }\n      ]\n    }\n    EOF\n\n    $ upssert ping.json\n\nA more complex example\n\n    $ cat \u003c\u003c EOF \u003e workflow.json\n    {\n      \"name\": \"Test against httpbin\",\n      \"tests\": [\n        {\n          \"name\": \"/get\",\n          \"request\": {\n            \"url\": \"https://httpbin.org/get?foo=bar\",\n            \"method\": \"GET\"\n          },\n          \"response\": {\n            \"content-type\": \"application/json\",\n            \"status-code\": {\n              \"equal\": 200\n            },\n            \"timing.dns-resolution\": {\n              \"is-below\": 100\n            },\n            \"timing.total\": {\n              \"is-below\": 500\n            },\n            \"body.args.foo\": \"bar\"\n          }\n        }, {\n          \"name\": \"/post formdata\",\n          \"requires\": [\"test1\"],\n          \"request\": {\n            \"url\": \"https://httpbin.org/post\",\n            \"method\": \"POST\",\n            \"form\": [\n              {\n                \"key\": \"out\",\n                \"value\": \"{{test1.body.args.foo}}\"\n              }\n            ]\n          },\n          \"response\": {\n            \"content-type\": \"application/json\",\n            \"status-code\": {\n              \"equal\": 200\n            },\n            \"timing.dns-resolution\": {\n              \"is-below\": 100\n            },\n            \"timing.total\": {\n              \"is-below\": 500\n            },\n            \"body.form.out\": \"bar\"\n          }\n        }, {\n          \"name\": \"/post raw data\",\n          \"requires\": [\"test1\", \"test2\"],\n          \"request\": {\n            \"url\": \"https://httpbin.org/post\",\n            \"method\": \"POST\",\n            \"headers\": {\n              \"Content-Type\": \"application/x-www-form-urlencoded\"\n            },\n            \"data\": \"test1-data={{test1.body.args.foo}}\u0026test2-data={{test2.body.form.out}}\"\n          },\n          \"response\": {\n            \"content-type\": \"application/json\",\n            \"status-code\": {\n              \"equal\": 200\n            },\n            \"timing.dns-resolution\": {\n              \"is-below\": 100\n            },\n            \"timing.total\": {\n              \"is-below\": 500\n            },\n            \"body.form[test1-data]\": \"bar\",\n            \"body.form[test2-data]\": \"bar\"\n          }\n        }\n      ]\n    }\n    EOF\n\n    $ upssert workflow.json\n\n### Programmatically\n\n    import Upssert from 'upssert';\n    const ping = {\n      name: 'Ping httpbin.org',\n      tests: [\n        {\n          name: 'Successfully pings httpbin.org',\n          request: {\n            url: 'https://httpbin.org',\n            method: 'GET',\n          },\n        },\n      ],\n    }\n\n    const upssert = new Upssert(ping);\n    upssert.execute();\n\n#### Reporters\n\nCurrently, there are only two reporters available\n\n##### ConsoleReporter (default)\n\nSimilar to [Mocha](https://mochajs.org/) Spec reporter.\n\n##### TapReporter\n\nOutputs test reports with the [TAP specification](https://testanything.org/tap-specification.html)\n\n\n    import Upssert, { TapReporter } from 'upssert';\n    const reporter = new TapReporter();\n    const upssert = new Upssert('https://httpbin.org/get', reporter);\n    upssert.execute();\n\n    1..1\n    ok 1 https://httpbin.org/get\n    # tests 1\n    # pass 1\n    # fail 0\n    # assertions 2\n\n#### Lifecycle\n\nUpssert uses the `EventEmitter` to emit events at runtime. The bundled reporters report on\nevents as they occur instead of collecting all output first and then writing out the formatted\nreport.\n\nThe following is an exhaustive list of events which are emitted\n\n - `suite.assertion.count (count)` emits `count` assertions for each test\n - `suite.test.count (count)` emits `count` tests for each suite\n - `suite.count (count)` emits `count` for each suite, which is usually `1`\n - `start` emitted when the test runner starts\n - `suite.start` emitted when a suite starts\n - `suite.fail` emitted if a suite fails and cannot continue. Generally for invalid test suite configuration.\n - `suite.test.start` emitted when a test starts\n - `suite.test.pass` emitted if none of the tests assertions fail\n - `suite.test.fail` emitted if any of the tests assertions fail\n - `suite.test.end` emitted when a test ends\n - `fail` emitted for every failure (`suite.test.fail`, `suite.fail`). Useful for marking a test run as failed.\n - `suite.end` emitted when a suite ends\n - `end` emitted when the test runner stops\n\n#### Custom Reporters\n\nUser-defined reporters can be passed to Upssert through the constructor.\n\nA custom implementation only requires that it expose a `setEventEmitter(emitter)` method which Upssert can\npass an event emitter into.\n\n    class CustomReporter {\n      setEventEmitter(emitter){\n        emitter.on('start', () =\u003e console.log('Started'));\n        emitter.on('end', () =\u003e console.log('Ended'));\n      }\n    }\n\n    const upssert = new Upssert('https://httpbin.org/get', new CustomReporter());\n    upssert.execute();\n\n*Inspired by the simplicity of [Ansible](https://www.ansible.com/)*\n\n## License\n\n[Apache 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnynotsolucky%2Fupssert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnnynotsolucky%2Fupssert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnynotsolucky%2Fupssert/lists"}