@kirrosh/zond 0.9.3 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirrosh/zond",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "API testing platform — define tests in YAML, run from CLI or WebUI, generate from OpenAPI specs",
5
5
  "license": "MIT",
6
6
  "module": "index.ts",
@@ -68,20 +68,30 @@ name: Suite Name # required
68
68
  base_url: "{{base_url}}" # or hardcoded URL
69
69
  tags: [smoke] # optional: smoke | crud | destructive | auth
70
70
  tests:
71
- - GET /endpoint: # method + path as YAML key
72
- query: { limit: 10 }
73
- expect:
74
- status: 200
75
- _body: { type: array }
71
+ - name: Get all items # required
72
+ GET: /items # method as YAML key, path as value
73
+ query: { limit: 10 }
74
+ expect:
75
+ status: 200
76
+ _body: { type: array, length_gt: 0 }
76
77
  \`\`\`
77
78
 
78
- ### Assertion operators
79
+ ### Path parameters
80
+ Inline the value directly — there is NO \`params\` field:
81
+ \`\`\`yaml
82
+ - name: Get item by ID
83
+ GET: /items/1 # hardcoded
84
+ - name: Get captured item
85
+ GET: /items/{{item_id}} # from prior capture
86
+ \`\`\`
87
+
88
+ ### Assertion operators (use inside expect)
79
89
  | Operator | Example |
80
90
  |----------|---------|
81
91
  | equals (default) | \`status: 200\` |
82
92
  | not_equals | \`status: { not_equals: 500 }\` |
83
93
  | contains | \`name: { contains: "john" }\` |
84
- | not_contains | \`body: { not_contains: "error" }\` |
94
+ | not_contains | \`error: { not_contains: "fatal" }\` |
85
95
  | exists / not_exists | \`id: { exists: true }\` |
86
96
  | gt / gte / lt / lte | \`count: { gte: 1 }\` |
87
97
  | matches (regex) | \`email: { matches: "^.+@.+$" }\` |
@@ -90,33 +100,46 @@ tests:
90
100
  | length_gt/gte/lt/lte | \`items: { length_gt: 0 }\` |
91
101
 
92
102
  ### Body assertions
93
- - \`_body\` — assert on entire response body: \`_body: { type: array }\`
103
+ - \`_body\` — assert on root response body: \`_body: { type: array }\`
104
+ - Combine operators in one key: \`_body: { type: array, length_gt: 0 }\`
94
105
  - Dot-notation for nested: \`data.user.id: { exists: true }\`
95
- - Array item access: \`items.0.name: { exists: true }\`
106
+ - Array element: \`items.0.name: { exists: true }\`
107
+ - YAML keys must be unique — do NOT repeat \`_body\` twice
96
108
 
97
109
  ### Request body (JSON)
98
110
  \`\`\`yaml
99
- - POST /resource:
100
- json: { name: "test", email: "a@b.com" }
101
- expect:
102
- status: 201
111
+ - name: Create resource
112
+ POST: /resources
113
+ json: { name: "test", email: "a@b.com" }
114
+ expect:
115
+ status: 201
116
+ id: { exists: true }
103
117
  \`\`\`
104
118
 
105
119
  ### Built-in generators
106
- \`{{$uuid}}\`, \`{{$randomInt}}\`, \`{{$timestamp}}\`, \`{{$isoTimestamp}}\`, \`{{$randomEmail}}\`, \`{{$randomString}}\`
120
+ \`{{$uuid}}\`, \`{{$randomInt}}\`, \`{{$timestamp}}\`, \`{{$randomName}}\`, \`{{$randomEmail}}\`, \`{{$randomString}}\`
107
121
 
108
122
  ### Variable capture & interpolation
109
123
  \`\`\`yaml
110
- - POST /items:
111
- json: { name: "test-{{$uuid}}" }
112
- capture:
113
- created_id: id # saves response.id
114
- expect:
115
- status: 201
116
- - GET /items/{{created_id}}:
117
- expect:
118
- status: 200
124
+ - name: Create item
125
+ POST: /items
126
+ json: { name: "test-{{$uuid}}" }
127
+ capture:
128
+ created_id: id # saves response.id
129
+ expect:
130
+ status: 201
131
+
132
+ - name: Get created item
133
+ GET: /items/{{created_id}}
134
+ expect:
135
+ status: 200
136
+ id: { equals: "{{created_id}}" }
119
137
  \`\`\`
138
+
139
+ ### Coverage matching
140
+ Use spec paths with \`{param}\` placeholders in the path for coverage to match:
141
+ - Spec says \`GET /products/{id}\` → write \`GET: /products/1\` (hardcode the value)
142
+ - Coverage scanner matches test paths against spec paths automatically
120
143
  `;
121
144
 
122
145
  export interface GuideOptions {