{"id":19426013,"url":"https://github.com/stackia/supertest-test2doc","last_synced_at":"2025-09-09T14:33:55.204Z","repository":{"id":57374911,"uuid":"84404646","full_name":"stackia/supertest-test2doc","owner":"stackia","description":"A supertest extension to make life easier with test2doc.js.","archived":false,"fork":false,"pushed_at":"2020-05-18T18:22:20.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T08:36:59.639Z","etag":null,"topics":["documentation-tool","javascript","supertest","test2doc","testing"],"latest_commit_sha":null,"homepage":null,"language":"API Blueprint","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackia.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":"2017-03-09T06:06:57.000Z","updated_at":"2018-01-31T15:38:19.000Z","dependencies_parsed_at":"2022-09-05T14:11:23.204Z","dependency_job_id":null,"html_url":"https://github.com/stackia/supertest-test2doc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackia%2Fsupertest-test2doc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackia%2Fsupertest-test2doc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackia%2Fsupertest-test2doc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackia%2Fsupertest-test2doc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackia","download_url":"https://codeload.github.com/stackia/supertest-test2doc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250674229,"owners_count":21469181,"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":["documentation-tool","javascript","supertest","test2doc","testing"],"created_at":"2024-11-10T14:05:39.844Z","updated_at":"2025-04-24T17:30:57.860Z","avatar_url":"https://github.com/stackia.png","language":"API Blueprint","funding_links":[],"categories":[],"sub_categories":[],"readme":"# supertest-test2doc\n\n[![npm](https://img.shields.io/npm/l/supertest-test2doc.svg)](https://www.npmjs.com/package/supertest-test2doc) [![npm](https://img.shields.io/npm/v/supertest-test2doc.svg)](https://www.npmjs.com/package/supertest-test2doc) [![Travis CI](https://travis-ci.org/stackia/supertest-test2doc.svg?branch=master)](https://travis-ci.org/stackia/supertest-test2doc) [![David](https://david-dm.org/stackia/supertest-test2doc/status.svg)](https://david-dm.org/stackia/supertest-test2doc) [![David](https://david-dm.org/stackia/supertest-test2doc/dev-status.svg)](https://david-dm.org/stackia/supertest-test2doc?type=dev) [![Gitter](https://img.shields.io/gitter/room/test2doc-js/Lobby.svg)](https://gitter.im/test2doc-js/Lobby)\n\nA [supertest](https://github.com/visionmedia/supertest) extension to make life easier with [test2doc.js](https://github.com/stackia/test2doc.js).\n\n## Usage\n\n```\nnpm install --save-dev supertest test2doc supertest-test2doc\n```\n\nSimple use `const request = require('supertest-test2doc')(require('supertest'))` and `request(app).with(doc)` and then you no longer need to write `doc.get/post/put/delete/query/resBody...`.\n\nE.g.\n\n```javascript\nconst doc = require('test2doc')\nconst request = require('supertest-test2doc')(require('supertest'))\nrequire('should')\n\n// For Koa, you should exports app.listen() or app.callback() in your app entry\nconst app = require('./my-express-app.js')\n\nafter(function () {\n  doc.emit('api-documentation.apib') // Or doc.emit('api-documentation.yaml', 'swagger') if you like Swagger\n})\n\ndoc.group('Products').is(doc =\u003e {\n  describe('#Products', function () {\n    doc.action('Get all products').is(doc =\u003e {\n      it('should get all products', function () {\n        return request(app).with(doc)\n          .get('/products')\n          .query({\n            minPrice: doc.val(10, 'Only products of which price \u003e= this value should be returned').required()\n          })\n          .expect(200)\n          .then(res =\u003e {\n            res.body.desc('List of all products')\n              .should.not.be.empty()\n            res.body[0].should.have.properties('id', 'name', 'price')\n            res.body[0].price.desc('Price of this product').should.be.a.Number()\n          })\n      })\n    })\n  })\n})\n```\n\nYou can find more examples [here](https://github.com/stackia/supertest-test2doc/blob/master/example/v2ex/v2ex.js).\n\n## License\n\nThe project is released under [MIT License](https://github.com/stackia/test2doc.js/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackia%2Fsupertest-test2doc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackia%2Fsupertest-test2doc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackia%2Fsupertest-test2doc/lists"}