Skip to content

Commit 05f2a4a

Browse files
author
ChaiJs Bot
committed
(data): Auto build _data
1 parent 38511a3 commit 05f2a4a

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

_data/plugin_keywords.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@
124124
"contains": [
125125
"contains"
126126
],
127+
"contract": [
128+
"contract"
129+
],
127130
"counting": [
128131
"counting"
129132
],

_data/plugins/api_contract_validator.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

plugins/api_contract_validator.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Using the plugin is easy. Simply point the plugin to your API definitions file p
2525
- Coverage report (can be printed to your terminal or exported to a json file)
2626
- Supports response format from `axios`, `superagent`, `supertest`, `request` and `light-my-request` (used by `fastify`)
2727
- Supports OpenAPI 3.0
28+
- Supports multiple definition files
29+
2830

2931
## How does it work?
3032
The api-contract-validator transforms your API definition into a json-schema based on the provided API documentation file. Then whenever the `matchApiSchema` assertion is called, it automatically extracts the method, path and status code from the response object returned by the API request that you invoked and validates the response object. Both the response headers and body are validated.
@@ -95,6 +97,11 @@ it('GET /pets/123', async () => {
9597
expect(response).toMatchApiSchema();
9698
})
9799
```
100+
## ***Multiple api definitions files***
101+
use apiDefinitionsPath option with an array of files paths
102+
```js
103+
const apiDefinitionsPath = [path.join(__dirname, 'myApp.yaml'), path.join(__dirname, 'myApp2.yaml')];
104+
```
98105

99106
## Descriptive assertion failures
100107
```js

0 commit comments

Comments
 (0)