@t0.labs/daxta 1.1.7 → 1.1.8

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.
@@ -175,8 +175,8 @@ function isSuccessStatus(status) {
175
175
  return status >= 200 && status < 300;
176
176
  }
177
177
  /**
178
- * Seed calls in the same it() share Jest's currentTestName.
179
- * SEMANTIC: create-then-assert-409 must not surface the setup 201.
178
+ * Each Jest case contributes one example. Keep its final matching request after
179
+ * filtering setup successes/errors, since a case may call the subject route twice.
180
180
  */
181
181
  function selectHitsForDocs(hits) {
182
182
  const byTest = new Map();
@@ -193,17 +193,18 @@ function selectHitsForDocs(hits) {
193
193
  const selected = [...unlabeled];
194
194
  for (const group of byTest.values()) {
195
195
  const section = (0, catalog_1.parseCaseSection)(group[0]?.test);
196
+ let candidates = group;
196
197
  if (section === 'semantic' || section === 'invalid' || section === 'omitted' || section === 'auth') {
197
198
  const errors = group.filter((hit) => !isSuccessStatus(hit.status));
198
- selected.push(...(errors.length ? errors : group));
199
- continue;
199
+ if (errors.length)
200
+ candidates = errors;
200
201
  }
201
- if (section === 'positive') {
202
+ else if (section === 'positive') {
202
203
  const ok = group.filter((hit) => isSuccessStatus(hit.status));
203
- selected.push(...(ok.length ? ok : group));
204
- continue;
204
+ if (ok.length)
205
+ candidates = ok;
205
206
  }
206
- selected.push(...group);
207
+ selected.push(candidates[candidates.length - 1]);
207
208
  }
208
209
  return selected;
209
210
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t0.labs/daxta",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "DAxTA — Tested behavior. Trusted API docs. Generate API documentation from observed test execution.",
5
5
  "license": "MIT",
6
6
  "author": {