{"_id":"vitest-openapi","_rev":"3-bd7dce0e78e9fae7ae7a8aece427b4f6","name":"vitest-openapi","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"vitest-openapi","version":"1.0.0","author":{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com","url":"https://github.com/yutak23"},"repository":{"type":"git","url":"git+ssh://git@github.com/yutak23/vitest-openapi.git"},"engines":{"node":">=16.0.0"},"license":"MIT","type":"module","types":"./index.d.ts","main":"./index.js","scripts":{"test":"vitest run --coverage","lint":"eslint . --ext .cjs,.mjs,.js","lint:fix":"eslint . --ext .cjs,.mjs,.js --fix","format":"prettier -c .","format:fix":"prettier --write .","ncu":"ncu"},"dependencies":{"jest-openapi":"^0.14.2","openapi-validator":"^0.14.2"},"devDependencies":{"@vitest/coverage-v8":"^0.34.5","app-root-path":"^3.1.0","eslint":"^8.50.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.28.1","fs-extra":"^11.1.1","npm-check-updates":"^16.14.4","npm-run-all":"^4.1.5","prettier":"^3.0.3","vitest":"^0.34.5"},"keywords":["js","javascript","ts","typescript","vitest","openapi","testing","response","validate","assertions"],"gitHead":"6dd9bd84ab7f4fb3920f9df92f1a73aa2381a137","description":"[![npm](https://img.shields.io/npm/v/vitest-openapi.svg)](https://www.npmjs.com/package/vitest-openapi) [![test](https://github.com/yutak23/vitest-openapi/actions/workflows/test.yaml/badge.svg)](https://github.com/yutak23/vitest-openapi/actions/workflows/","bugs":{"url":"https://github.com/yutak23/vitest-openapi/issues"},"homepage":"https://github.com/yutak23/vitest-openapi#readme","_id":"vitest-openapi@1.0.0","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-5OqQMJ358vCOcZINxTUZhIneDHR9ovMYQlJ2AaDOmZ+OP95wYz+rs6LTYmkaVTw6hYfcmueczOLRP00F+5yiCQ==","shasum":"557e21929e2b044cfac6dfa2197eac35ea81a054","tarball":"https://registry.npmjs.org/vitest-openapi/-/vitest-openapi-1.0.0.tgz","fileCount":5,"unpackedSize":6283,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGnF9QR+QBCkTVePquSybQc909Hgkz60Rg1XmWaQ0JsIAiEA131q5bzIwry7UPT/8I49rWKzUj9bsci8ERnWmlPFyzk="}]},"_npmUser":{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com"},"directories":{},"maintainers":[{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vitest-openapi_1.0.0_1695968393326_0.4408536042279816"},"_hasShrinkwrap":false},"1.0.1":{"name":"vitest-openapi","version":"1.0.1","author":{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com","url":"https://github.com/yutak23"},"repository":{"type":"git","url":"git+ssh://git@github.com/yutak23/vitest-openapi.git"},"engines":{"node":">=16.0.0"},"license":"MIT","type":"module","types":"./index.d.ts","main":"./index.js","scripts":{"test":"vitest run --coverage","lint":"eslint . --ext .cjs,.mjs,.js","lint:fix":"eslint . --ext .cjs,.mjs,.js --fix","format":"prettier -c .","format:fix":"prettier --write .","ncu":"ncu"},"dependencies":{"jest-openapi":"^0.14.2","openapi-validator":"^0.14.2"},"devDependencies":{"@vitest/coverage-v8":"^0.34.5","app-root-path":"^3.1.0","eslint":"^8.50.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.28.1","fs-extra":"^11.1.1","npm-check-updates":"^16.14.4","npm-run-all":"^4.1.5","prettier":"^3.0.3","vitest":"^0.34.5"},"keywords":["js","javascript","ts","typescript","vitest","openapi","testing","response","validate","assertions"],"gitHead":"f68d1fa8cc8da24557f706ed02be55c7d201062c","description":"[![npm](https://img.shields.io/npm/v/vitest-openapi.svg)](https://www.npmjs.com/package/vitest-openapi) [![test](https://github.com/yutak23/vitest-openapi/actions/workflows/test.yaml/badge.svg)](https://github.com/yutak23/vitest-openapi/actions/workflows/","bugs":{"url":"https://github.com/yutak23/vitest-openapi/issues"},"homepage":"https://github.com/yutak23/vitest-openapi#readme","_id":"vitest-openapi@1.0.1","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-kzBxFKIbf1wxxY8Z/eZHidVfi8hkZADjbxODPWzXzJtC1868l2PcwCe6vlpaI3qY/c5I987j90qsubxQSUJGvw==","shasum":"33cd2822db59ab19fb168266bdb6ef944010a0b3","tarball":"https://registry.npmjs.org/vitest-openapi/-/vitest-openapi-1.0.1.tgz","fileCount":5,"unpackedSize":6106,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCc/VYTzekINgfKFBrV0oYFTtupBHBvXeBXS1XmiAt4QgIgd4czBPUc3cvnftP3soPKcTc/JoUED+mNEv1+g7ABp4o="}]},"_npmUser":{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com"},"directories":{},"maintainers":[{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vitest-openapi_1.0.1_1695972210764_0.06902529570891058"},"_hasShrinkwrap":false},"1.0.2":{"name":"vitest-openapi","version":"1.0.2","author":{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com","url":"https://github.com/yutak23"},"repository":{"type":"git","url":"git+ssh://git@github.com/yutak23/vitest-openapi.git"},"engines":{"node":">=16.0.0"},"license":"MIT","type":"module","types":"./index.d.ts","main":"./index.js","scripts":{"test":"vitest run --coverage","lint":"eslint . --ext .cjs,.mjs,.js","lint:fix":"eslint . --ext .cjs,.mjs,.js --fix","format":"prettier -c .","format:fix":"prettier --write .","ncu":"ncu"},"dependencies":{"jest-openapi":"^0.14.2","openapi-validator":"^0.14.2"},"devDependencies":{"@vitest/coverage-v8":"^0.34.5","app-root-path":"^3.1.0","eslint":"^8.50.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.28.1","fs-extra":"^11.1.1","npm-check-updates":"^16.14.4","npm-run-all":"^4.1.5","prettier":"^3.0.3","vitest":"^0.34.5"},"keywords":["js","javascript","ts","typescript","vitest","openapi","testing","response","validate","assertions"],"gitHead":"c9303be24687edc23a97d6cf29630fa8b82e58fc","description":"[![npm](https://img.shields.io/npm/v/vitest-openapi.svg)](https://www.npmjs.com/package/vitest-openapi) [![test](https://github.com/yutak23/vitest-openapi/actions/workflows/test.yaml/badge.svg)](https://github.com/yutak23/vitest-openapi/actions/workflows/","bugs":{"url":"https://github.com/yutak23/vitest-openapi/issues"},"homepage":"https://github.com/yutak23/vitest-openapi#readme","_id":"vitest-openapi@1.0.2","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-V2Dwy9ptrs9lcDcxzK8PrdJGvNbdufqyMrpaeFcBQNHYMNrl0PxWCF8Sa0L3KMuT5rej1BA247ppPE/KCiTI/w==","shasum":"a500769c93eaf8599c1ad3c84da16fb63f0c8b8e","tarball":"https://registry.npmjs.org/vitest-openapi/-/vitest-openapi-1.0.2.tgz","fileCount":5,"unpackedSize":6054,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXjVdQbzfe/IwHpB7vnLnuP/wSl5Midud/DEyjjyXpYAIhAIPim3iA6HdzIzXJVKjEy/SzmDmmQcC/JOBPeTs5d4+E"}]},"_npmUser":{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com"},"directories":{},"maintainers":[{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vitest-openapi_1.0.2_1695972364343_0.08384621505771572"},"_hasShrinkwrap":false},"1.0.3":{"name":"vitest-openapi","version":"1.0.3","author":{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com","url":"https://github.com/yutak23"},"repository":{"type":"git","url":"git+ssh://git@github.com/yutak23/vitest-openapi.git"},"engines":{"node":">=16.0.0"},"license":"MIT","type":"module","types":"./dist/index.d.ts","main":"./dist/index.js","scripts":{"build":"run-s lint clean tsc","tsc":"tsc -p ./tsconfig.json","clean":"rm -rf ./dist","test":"vitest run --coverage","lint":"eslint . --ext .cjs,.mjs,.js,.ts,.cts,.mts","lint:fix":"eslint . --ext .cjs,.mjs,.js,.ts,.cts,.mts --fix","format":"prettier -c .","format:fix":"prettier --write .","ncu":"ncu"},"dependencies":{"jest-openapi":"^0.14.2","openapi-validator":"^0.14.2"},"devDependencies":{"@tsconfig/node16":"^16.1.1","@tsconfig/recommended":"^1.0.3","@types/fs-extra":"^11.0.2","@typescript-eslint/eslint-plugin":"^6.7.3","@typescript-eslint/parser":"^6.7.3","@vitest/coverage-v8":"^0.34.5","app-root-path":"^3.1.0","eslint":"^8.50.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-airbnb-typescript":"^17.1.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.28.1","fs-extra":"^11.1.1","npm-check-updates":"^16.14.4","npm-run-all":"^4.1.5","prettier":"^3.0.3","typescript":"^5.2.2","vitest":"^0.34.5"},"keywords":["js","javascript","ts","typescript","vitest","openapi","testing","response","validate","assertions"],"gitHead":"0908a6284611d0680a17026585484b2e61c3abcd","description":"[![npm](https://img.shields.io/npm/v/vitest-openapi.svg)](https://www.npmjs.com/package/vitest-openapi) [![test](https://github.com/yutak23/vitest-openapi/actions/workflows/test.yaml/badge.svg)](https://github.com/yutak23/vitest-openapi/actions/workflows/","bugs":{"url":"https://github.com/yutak23/vitest-openapi/issues"},"homepage":"https://github.com/yutak23/vitest-openapi#readme","_id":"vitest-openapi@1.0.3","_nodeVersion":"18.17.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-aBBep8Bdo9HaDIJV4H8j1HLUIcNdvxQ9XZhX4VEU2Eb6SsZ8bykybCZfHnNGe6crM2KUlfUcJhLYC0LSP27Egg==","shasum":"f15127e1842093ddb6b324407f09de7fc5fa24e0","tarball":"https://registry.npmjs.org/vitest-openapi/-/vitest-openapi-1.0.3.tgz","fileCount":6,"unpackedSize":6958,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH2CrinbAzFHV+R6fDqCyNTHwFLbAlUSZjDKazsNfmSMCIQDGMsJ5E2Gtnq2yWpfJGMo9V4k0z3M8YvLZgRi1NMC5Og=="}]},"_npmUser":{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com"},"directories":{},"maintainers":[{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vitest-openapi_1.0.3_1696208171545_0.17408058658769687"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-29T06:19:53.326Z","1.0.0":"2023-09-29T06:19:53.567Z","modified":"2023-10-02T00:56:11.910Z","1.0.1":"2023-09-29T07:23:30.922Z","1.0.2":"2023-09-29T07:26:04.515Z","1.0.3":"2023-10-02T00:56:11.716Z"},"maintainers":[{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com"}],"description":"[![npm](https://img.shields.io/npm/v/vitest-openapi.svg)](https://www.npmjs.com/package/vitest-openapi) [![test](https://github.com/yutak23/vitest-openapi/actions/workflows/test.yaml/badge.svg)](https://github.com/yutak23/vitest-openapi/actions/workflows/","homepage":"https://github.com/yutak23/vitest-openapi#readme","keywords":["js","javascript","ts","typescript","vitest","openapi","testing","response","validate","assertions"],"repository":{"type":"git","url":"git+ssh://git@github.com/yutak23/vitest-openapi.git"},"author":{"name":"yutak23","email":"yuta.katayama.23+github@gmail.com","url":"https://github.com/yutak23"},"bugs":{"url":"https://github.com/yutak23/vitest-openapi/issues"},"license":"MIT","readme":"# vitest-openapi\n\n[![npm](https://img.shields.io/npm/v/vitest-openapi.svg)](https://www.npmjs.com/package/vitest-openapi)\n[![test](https://github.com/yutak23/vitest-openapi/actions/workflows/test.yaml/badge.svg)](https://github.com/yutak23/vitest-openapi/actions/workflows/test.yaml)\n![style](https://img.shields.io/badge/code%20style-airbnb-ff5a5f.svg)\n[![included](https://badgen.net/npm/types/jest-openapi)](https://github.com/yutak23/vitest-openapi/blob/main/index.d.ts)\n\nUse Vitest to assert that HTTP responses satisfy an OpenAPI spec.\n\nThis library makes [jest-openapi](https://github.com/openapi-library/OpenAPIValidators/tree/master/packages/jest-openapi) functionality available to Vitest.\n\n## Features\n\n- Validates the status and body of HTTP responses against your OpenAPI spec [(see usage)](#usage)\n- Validates objects against schemas defined in your OpenAPI spec [(see usage)](#usage)\n- Load your OpenAPI spec just once in your tests (load from a filepath or object)\n- Supports OpenAPI [2](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) and [3](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md)\n- Supports OpenAPI specs in YAML and JSON formats\n- Supports `$ref` in response definitions (i.e. `$ref: '#/definitions/ComponentType/ComponentName'`)\n- Informs you if your OpenAPI spec is invalid\n- Supports responses from `axios`, `request-promise`, `supertest`, `superagent`, and `chai-http`\n- Use in [Vitest](#usage)\n\n## Installation\n\n### npm\n\n```sh\n$ npm install vitest-openapi\n```\n\n### yarn\n\n```sh\n$ yarn add vitest-openapi\n```\n\n## Usage\n\n```js\nimport { describe, expect, it } from 'vitest';\nimport vitestOpenAPI from 'vitest-openapi';\nimport axios from 'axios';\n\n// Load an OpenAPI file (YAML or JSON) into this plugin\nvitestOpenAPI('path/to/openapi.yml');\n\n// Write your test\ndescribe('GET /example/endpoint', () => {\n\tit('should satisfy OpenAPI spec', async () => {\n\t\t// Get an HTTP response from your server (e.g. using axios)\n\t\tconst res = await axios.get('http://localhost:3000/example/endpoint');\n\n\t\texpect(res.status).toEqual(200);\n\n\t\t// Assert that the HTTP response satisfies the OpenAPI spec\n\t\texpect(res).toSatisfyApiSpec();\n\t});\n});\n```\n\n※See also the [Usage section of jest-openapi](https://github.com/openapi-library/OpenAPIValidators/tree/master/packages/jest-openapi#usage) for more information.\n\n## Requirement\n\nIf you use TypeScript, need `vitest >= 0.31.0` (see the site [Extending Matchers](https://vitest.dev/guide/extending-matchers.html)).\n\n## License\n\n[MIT licensed](./LICENSE)\n","readmeFilename":"README.md"}