@thymian/rules-testing 0.4.0-canary.20261123-321a806 → 0.4.1
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/README.md +10 -8
- package/dist/conforming-response.d.ts +4 -1
- package/dist/conforming-response.d.ts.map +1 -1
- package/dist/conforming-response.js +8 -2
- package/dist/conforming-response.js.map +1 -1
- package/dist/recorded.d.ts +3 -2
- package/dist/recorded.d.ts.map +1 -1
- package/dist/recorded.js +8 -3
- package/dist/recorded.js.map +1 -1
- package/dist/rule-test-execution.d.ts +4 -5
- package/dist/rule-test-execution.d.ts.map +1 -1
- package/dist/rule-test-execution.js.map +1 -1
- package/dist/run-analyze.d.ts +4 -2
- package/dist/run-analyze.d.ts.map +1 -1
- package/dist/run-analyze.js +8 -4
- package/dist/run-analyze.js.map +1 -1
- package/dist/run-test.d.ts.map +1 -1
- package/dist/run-test.js +34 -12
- package/dist/run-test.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -78,10 +78,10 @@ await ruleTester.runTest(format, {
|
|
|
78
78
|
|
|
79
79
|
Here `launchCreated` is `failed`: the server dropped the `Location` header the format declares. One condition can change many answers, for example `conforming.statusCode >= 400`. One operation with two answers gets two requests, one aimed at each transaction.
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
The tester does not ask the rule about a transaction in `test`, and gives a `reason`, when:
|
|
82
82
|
|
|
83
|
-
- **The server answers another status than the transaction declares
|
|
84
|
-
- **The request cannot be built**, for example for a path parameter without an example: give its schema one, `createRequiredParameter({ schema: createStringSchema({ examples: ['apollo-11'] }) })`.
|
|
83
|
+
- **The live pair is outside the rule's applicability**, for example because the server answers another status than the transaction declares. The transaction is `notApplicable`, as `thymian test` reports it.
|
|
84
|
+
- **The request cannot be built**, for example for a path parameter without an example: give its schema one, `createRequiredParameter({ schema: createStringSchema({ examples: ['apollo-11'] }) })`. The transaction is `skipped`.
|
|
85
85
|
|
|
86
86
|
### The traffic in `analytics`
|
|
87
87
|
|
|
@@ -97,6 +97,8 @@ The analyzer recognises a transaction in a recording by method, origin, path, st
|
|
|
97
97
|
|
|
98
98
|
A request that cannot be built, for example for a path parameter without an example, makes `analytics` throw and name the transaction: there is nothing to record for it. Give the parameter's schema an example, as for `test`.
|
|
99
99
|
|
|
100
|
+
A `default` transaction is not recorded: its response declares no status to answer with. It is listed with the transactions that were never recorded, as `notApplicable`. To record one, name the status it answers with in `recorded`.
|
|
101
|
+
|
|
100
102
|
**Traffic you hand in** replaces it. `traffic` is a list of recorded pairs, each a request and its response as plain HTTP objects. `recorded(format, transactionId, overrides?)` gives the conforming pair of a transaction, so you write only what deviates:
|
|
101
103
|
|
|
102
104
|
```typescript
|
|
@@ -116,9 +118,9 @@ expect(executions).toMatchObject([
|
|
|
116
118
|
|
|
117
119
|
A transaction may be recorded several times, and each recording is judged on its own: here the second one dropped the `Location` header the format declares. The list is then in another order than for `static`: one entry per recording, in traffic order; then the transactions that were never recorded, as `notApplicable`; then executions on any other location.
|
|
118
120
|
|
|
119
|
-
An override replaces a field of the conforming request or response as a whole: `{ request: { headers: { authorization: 'Bearer apollo' } } }` records exactly that request header, which is how a rule about a request header is tested. One thing is kept: the media type the format declares is still named as `content-type`, because the analyzer recognises the transaction by it, unless the headers you give name a `content-type` themselves. `recorded` throws for an id the format has no transaction with,
|
|
121
|
+
An override replaces a field of the conforming request or response as a whole: `{ request: { headers: { authorization: 'Bearer apollo' } } }` records exactly that request header, which is how a rule about a request header is tested. One thing is kept: the media type the format declares is still named as `content-type`, because the analyzer recognises the transaction by it, unless the headers you give name a `content-type` themselves. `recorded` throws for an id the format has no transaction with, for a request that cannot be built, and for a `default` transaction unless the override names its status: `{ response: { statusCode: 503 } }`.
|
|
120
122
|
|
|
121
|
-
A recording that the analyzer matches to no transaction of the format, for example one with another
|
|
123
|
+
A recording that the analyzer matches to no transaction of the format has no transaction to appear on. When its request still matches an operation and only the response is undocumented, for example one with another status or media type, what the rule says about it is located on that operation's request node. Otherwise, for example for another path, it is located on a free string, the label of the recording. Either way it comes last:
|
|
122
124
|
|
|
123
125
|
```typescript
|
|
124
126
|
const executions = await ruleTester.runAnalyze(format, {
|
|
@@ -164,7 +166,7 @@ expect(await createRuleTester(resourcesSendEtagConsistently).runLint(format)).to
|
|
|
164
166
|
]);
|
|
165
167
|
```
|
|
166
168
|
|
|
167
|
-
The key is what the context grouped by, spelled as that context spells it: grouped by `url()`, `static` and `test` give `https://localhost:443/launches` where `analytics` gives `https://localhost/launches`. In `test` the tester sends the requests of a group together
|
|
169
|
+
The key is what the context grouped by, spelled as that context spells it: grouped by `url()`, `static` and `test` give `https://localhost:443/launches` where `analytics` gives `https://localhost/launches`. In `test` the tester sends the requests of a group together. A member the server answers outside the rule's applicability is not judged: it is `notApplicable`, with a `reason`, and the rule judges the other members.
|
|
168
170
|
|
|
169
171
|
### What comes back
|
|
170
172
|
|
|
@@ -176,7 +178,7 @@ A list of executions. Each one has:
|
|
|
176
178
|
| `status` | `failed`, `passed`, `notApplicable` or `skipped`. |
|
|
177
179
|
| `message` | When `failed`: the violation's message, or the rule's summary or description when it gives none. |
|
|
178
180
|
| `severity` | When `failed`: the severity the rule declares. |
|
|
179
|
-
| `reason` | When `skipped`: the reason the rule gave.
|
|
181
|
+
| `reason` | When `skipped`: the reason the rule gave. When `notApplicable` in `test`: why the live pair is outside the rule's applicability. |
|
|
180
182
|
| `group` | When a grouped rule located the execution on a group and not on one member: the group key. See [Grouped rules](#grouped-rules). |
|
|
181
183
|
| `findings` | What the rule attached to the execution, as a report carries it. Always a list; empty when the rule attached nothing. |
|
|
182
184
|
|
|
@@ -184,7 +186,7 @@ The `label` is the readable name of the location, so a failing comparison says w
|
|
|
184
186
|
|
|
185
187
|
**Order.** Every transaction of the format, in the order it was added. A transaction the engine reported several executions on appears once per execution, in the order the engine reported them. In `analytics` an execution on the label of a recorded pair counts as reported on the transaction the pair matched: it takes that transaction's place and keeps the label as its `location`. The analyzer locates there what a rule returns from `validateCapturedHttpTransactions` and `validateCapturedHttpTraces`. Executions on any other location come last. With traffic handed to `analytics` the recordings come first, in traffic order, as described above.
|
|
186
188
|
|
|
187
|
-
**Where `passed` and `notApplicable` come from.** In `test` the tester reports an execution for every transaction it sent a request for, `passed` and `
|
|
189
|
+
**Where `passed` and `notApplicable` come from.** The statuses are the ones a Thymian report uses. In `test` the tester reports an execution for every transaction it sent a request for, `passed`, `skipped` and `notApplicable` included: a transaction whose response falls outside the rule's `appliesTo` is `notApplicable`, with a `reason`, as it is in `static` and `analytics`. `createRuleTester` takes them as reported and adds `notApplicable` for a transaction no request was sent for. The tester also reports a rule that applied to nothing with one execution of its own; a rule test leaves it out, since every transaction in its list already says `notApplicable`. The linter and the analyzer report only what a rule returns, which for most rules is its violations. In `static` and `analytics`, `createRuleTester` works out the rest from the `appliesTo` the rule states in its rule-context calls: a transaction inside it that the engine reported nothing on is `passed`, one outside it is `notApplicable`. Several calls count together; a transaction is applicable when any of them accepts it. `static` asks the `appliesTo` of the format, `analytics` of the recorded pair, so two recordings of one transaction can differ in it.
|
|
188
190
|
|
|
189
191
|
A rule whose applicability cannot be read from outside gets `passed` for every transaction it did not flag. That is a rule that passes only a violation condition or makes no rule-context call at all, and:
|
|
190
192
|
|
|
@@ -4,6 +4,9 @@ import { type HttpResponse, type ThymianHttpResponse } from '@thymian/core';
|
|
|
4
4
|
* the declared status, every declared header (required or not) with a value,
|
|
5
5
|
* the declared media type as `content-type`, and a body where the format
|
|
6
6
|
* declares a schema for one.
|
|
7
|
+
*
|
|
8
|
+
* A `default` response declares no status, so `statusCode` names the one to
|
|
9
|
+
* answer with; without it, a `default` response throws.
|
|
7
10
|
*/
|
|
8
|
-
export declare function conformingResponse(declared: ThymianHttpResponse): HttpResponse;
|
|
11
|
+
export declare function conformingResponse(declared: ThymianHttpResponse, statusCode?: number | 'default'): HttpResponse;
|
|
9
12
|
//# sourceMappingURL=conforming-response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conforming-response.d.ts","sourceRoot":"","sources":["../src/conforming-response.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,mBAAmB,EAEzB,MAAM,eAAe,CAAC;AAEvB
|
|
1
|
+
{"version":3,"file":"conforming-response.d.ts","sourceRoot":"","sources":["../src/conforming-response.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,mBAAmB,EAEzB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,mBAAmB,EAC7B,UAAU,GAAE,MAAM,GAAG,SAA+B,GACnD,YAAY,CAkCd"}
|
|
@@ -4,8 +4,14 @@ import { serializeBody, serializeHeaderParameter, } from '@thymian/core';
|
|
|
4
4
|
* the declared status, every declared header (required or not) with a value,
|
|
5
5
|
* the declared media type as `content-type`, and a body where the format
|
|
6
6
|
* declares a schema for one.
|
|
7
|
+
*
|
|
8
|
+
* A `default` response declares no status, so `statusCode` names the one to
|
|
9
|
+
* answer with; without it, a `default` response throws.
|
|
7
10
|
*/
|
|
8
|
-
export function conformingResponse(declared) {
|
|
11
|
+
export function conformingResponse(declared, statusCode = declared.statusCode) {
|
|
12
|
+
if (statusCode === 'default') {
|
|
13
|
+
throw new Error('A default response declares no status code, so it has no conforming response: name the status to answer with.');
|
|
14
|
+
}
|
|
9
15
|
const headers = {};
|
|
10
16
|
for (const [name, { schema, style }] of Object.entries(declared.headers)) {
|
|
11
17
|
const value = valueOf(schema);
|
|
@@ -21,7 +27,7 @@ export function conformingResponse(declared) {
|
|
|
21
27
|
? undefined
|
|
22
28
|
: serializeBody(valueOf(declared.schema));
|
|
23
29
|
return {
|
|
24
|
-
statusCode
|
|
30
|
+
statusCode,
|
|
25
31
|
headers,
|
|
26
32
|
...(body === undefined ? {} : { body }),
|
|
27
33
|
trailers: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conforming-response.js","sourceRoot":"","sources":["../src/conforming-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,wBAAwB,GAGzB,MAAM,eAAe,CAAC;AAEvB
|
|
1
|
+
{"version":3,"file":"conforming-response.js","sourceRoot":"","sources":["../src/conforming-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,wBAAwB,GAGzB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAA6B,EAC7B,aAAiC,QAAQ,CAAC,UAAU;IAEpD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACb,+GAA+G,CAChH,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAA4B,EAAE,CAAC;IAE5C,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACzE,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAE9B,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACzB,OAAO,KAAK,KAAK,QAAQ;gBACvB,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,wBAAwB,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,QAAQ,CAAC,SAAS,KAAK,EAAE,EAAE,CAAC;QAC9B,OAAO,CAAC,cAAc,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC;IAC/C,CAAC;IAED,MAAM,IAAI,GACR,QAAQ,CAAC,MAAM,KAAK,SAAS;QAC3B,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAE9C,OAAO;QACL,UAAU;QACV,OAAO;QACP,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QACvC,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,CAAC;KACZ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,OAAO,CAAC,MAAqB;IACpC,MAAM,KAAK,GAAG;QACZ,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACpB,MAAM,CAAC,KAAK;QACZ,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAChB,MAAM,CAAC,OAAO;KACf,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;IAEvC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,QAAQ,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAClE,KAAK,QAAQ;YACX,OAAO,EAAE,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,EAAE,CAAC;QACZ,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS;YACZ,OAAO,CAAC,CAAC;QACX,KAAK,SAAS;YACZ,OAAO,IAAI,CAAC;QACd,KAAK,MAAM;YACT,OAAO,IAAI,CAAC;QACd;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC"}
|
package/dist/recorded.d.ts
CHANGED
|
@@ -25,8 +25,9 @@ export type RecordedOverrides = {
|
|
|
25
25
|
* with the examples it carries, answered as the format declares it. `overrides`
|
|
26
26
|
* replace fields of the request and of the response.
|
|
27
27
|
*
|
|
28
|
-
* Throws when the format has no transaction with that id,
|
|
29
|
-
* cannot be built from the format
|
|
28
|
+
* Throws when the format has no transaction with that id, when the request
|
|
29
|
+
* cannot be built from the format, and when the transaction's response is the
|
|
30
|
+
* `default` one and `overrides.response.statusCode` names no status for it.
|
|
30
31
|
*
|
|
31
32
|
* @example
|
|
32
33
|
* ```typescript
|
package/dist/recorded.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorded.d.ts","sourceRoot":"","sources":["../src/recorded.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EAEjB,KAAK,aAAa,EAGnB,MAAM,eAAe,CAAC;AAKvB;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAClC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"recorded.d.ts","sourceRoot":"","sources":["../src/recorded.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EAEjB,KAAK,aAAa,EAGnB,MAAM,eAAe,CAAC;AAKvB;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,MAAM,EACrB,SAAS,GAAE,iBAAsB,GAChC,YAAY,CAkCd"}
|
package/dist/recorded.js
CHANGED
|
@@ -6,8 +6,9 @@ import { conformingResponse } from './conforming-response.js';
|
|
|
6
6
|
* with the examples it carries, answered as the format declares it. `overrides`
|
|
7
7
|
* replace fields of the request and of the response.
|
|
8
8
|
*
|
|
9
|
-
* Throws when the format has no transaction with that id,
|
|
10
|
-
* cannot be built from the format
|
|
9
|
+
* Throws when the format has no transaction with that id, when the request
|
|
10
|
+
* cannot be built from the format, and when the transaction's response is the
|
|
11
|
+
* `default` one and `overrides.response.statusCode` names no status for it.
|
|
11
12
|
*
|
|
12
13
|
* @example
|
|
13
14
|
* ```typescript
|
|
@@ -26,8 +27,12 @@ export function recorded(format, transactionId, overrides = {}) {
|
|
|
26
27
|
}
|
|
27
28
|
const { thymianReq, thymianRes } = transaction;
|
|
28
29
|
const request = { ...conformingRequest(transaction), ...overrides.request };
|
|
30
|
+
const statusCode = overrides.response?.statusCode ?? thymianRes.statusCode;
|
|
31
|
+
if (statusCode === 'default') {
|
|
32
|
+
throw new Error(`Cannot record "${transactionId}": its response is the default one, which declares no status code. Name one as response.statusCode in the overrides.`);
|
|
33
|
+
}
|
|
29
34
|
const response = {
|
|
30
|
-
...conformingResponse(thymianRes),
|
|
35
|
+
...conformingResponse(thymianRes, statusCode),
|
|
31
36
|
...overrides.response,
|
|
32
37
|
};
|
|
33
38
|
return {
|
package/dist/recorded.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorded.js","sourceRoot":"","sources":["../src/recorded.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAGhB,8BAA8B,GAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAyB9D
|
|
1
|
+
{"version":3,"file":"recorded.js","sourceRoot":"","sources":["../src/recorded.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,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AiB,CAAC,WAAmC;IAC5D,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;IAE/C,IAAI,CAAC;QACH,OAAO,gBAAgB,CAAC;YACtB,eAAe,EAAE,sBAAsB,CAAC,WAAW,CAAC;YACpD,MAAM,EAAE,WAAW;SACpB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,kBAAkB,8BAA8B,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EACtI,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CACtB,UAAmC,EAAE,EACrC,SAAiB;IAEjB,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CACrC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,cAAc,CAChD,CAAC;IAEF,OAAO,SAAS,KAAK,EAAE,IAAI,KAAK;QAC9B,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { type FindingRecord, type Rule, type RuleSeverity, type RuleViolationLocation, type RunRulesResult, type ThymianFormat, type ThymianHttpTransaction } from '@thymian/core';
|
|
1
|
+
import { type ExecutionStatus, type FindingRecord, type Rule, type RuleSeverity, type RuleViolationLocation, type RunRulesResult, type ThymianFormat, type ThymianHttpTransaction } from '@thymian/core';
|
|
2
2
|
import type { RuleUnderTest } from './rule-under-test.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* `failed`, `passed` and `skipped`.
|
|
4
|
+
* The status of an execution, spelled as the report spells it (ADR-0030).
|
|
6
5
|
*/
|
|
7
|
-
export type RuleTestExecutionStatus = '
|
|
6
|
+
export type RuleTestExecutionStatus = ExecutionStatus['kind'];
|
|
8
7
|
/**
|
|
9
8
|
* What a rule said about one location, in one validation context.
|
|
10
9
|
*/
|
|
@@ -24,7 +23,7 @@ export type RuleTestExecution = {
|
|
|
24
23
|
* a rule that ships disabled.
|
|
25
24
|
*/
|
|
26
25
|
severity?: RuleSeverity;
|
|
27
|
-
/** Present when `skipped` and the
|
|
26
|
+
/** Present when `skipped` or `notApplicable` and the engine gave a reason. */
|
|
28
27
|
reason?: string;
|
|
29
28
|
/**
|
|
30
29
|
* Present when a grouped rule located the execution on a group as a whole
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-test-execution.d.ts","sourceRoot":"","sources":["../src/rule-test-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAGlB,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAE5B,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"rule-test-execution.d.ts","sourceRoot":"","sources":["../src/rule-test-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,aAAa,EAGlB,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAE5B,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAE9D;;GAEG;AACH,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AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,qBAAqB,GAC9B,MAAM,GAAG,SAAS,CAIpB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EACtB,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,aAAa,EACzC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,iBAAiB,EAAE,CAyCrB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,qBAAqB,EAC/B,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,IAAI,GACT,qBAAqB,CAYvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-test-execution.js","sourceRoot":"","sources":["../src/rule-test-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,
|
|
1
|
+
{"version":3,"file":"rule-test-execution.js","sourceRoot":"","sources":["../src/rule-test-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAG5B,4BAA4B,EAC5B,wBAAwB,EAOxB,8BAA8B,GAC/B,MAAM,eAAe,CAAC;AA4CvB;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAqB,EACrB,QAA6B,EAC7B,YAAgD,EAChD,gBAA+B,iBAAiB;IAEhD,MAAM,YAAY,GAAG,MAAM,CAAC,0BAA0B,EAAE,CAAC;IAEzD,OAAO;QACL,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CACtC,YAAY,CACV,WAAW,EACX,QAAQ,EACR,YAAY,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,EACpE,aAAa,CACd,CACF;QACD,GAAG,mBAAmB,CAAC,YAAY,EAAE,QAAQ,EAAE,aAAa,CAAC;KAC9D,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,U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js';
|
|
5
5
|
/**
|
|
6
6
|
* Runs a rule in `analytics` against the traffic: every transaction of the
|
|
7
|
-
* format recorded once, conforming, unless traffic is handed in.
|
|
7
|
+
* format recorded once, conforming, unless traffic is handed in. A `default`
|
|
8
|
+
* transaction declares no status to answer with, so it is not recorded.
|
|
8
9
|
*
|
|
9
10
|
* The list is the recordings in traffic order, each on the transaction of the
|
|
10
11
|
* format it matches, then the transactions that were never recorded, then the
|
|
@@ -12,7 +13,8 @@ import type { RuleUnderTest } from './rule-under-test.js';
|
|
|
12
13
|
* located on a recording's label takes the place of the transaction that
|
|
13
14
|
* recording matched and keeps the label as its location. A recording that
|
|
14
15
|
* matches no transaction has no entry of its own: what the engine reports on
|
|
15
|
-
* it, it locates on
|
|
16
|
+
* it, it locates on the operation's request node when only the response is
|
|
17
|
+
* undocumented, otherwise on a free string.
|
|
16
18
|
*/
|
|
17
19
|
export declare function runAnalyze(underTest: RuleUnderTest, format: ThymianFormat, handedIn?: RecordedPair[]): Promise<RuleTestExecution[]>;
|
|
18
20
|
//# sourceMappingURL=run-analyze.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-analyze.d.ts","sourceRoot":"","sources":["../src/run-analyze.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"run-analyze.d.ts","sourceRoot":"","sources":["../src/run-analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAML,KAAK,iBAAiB,EAGvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAiC1D;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,aAAa,EACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,GACxB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAyG9B"}
|
package/dist/run-analyze.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { httpTransactionToLabel, NoopLogger, runRules, } from '@thymian/core';
|
|
1
|
+
import { httpTransactionToLabel, isDefaultResponse, NoopLogger, runRules, } from '@thymian/core';
|
|
2
2
|
import { AnalyticsApiContext, SqliteHttpTransactionRepository, } from '@thymian/plugin-http-analyzer';
|
|
3
3
|
import { recorded } from './recorded.js';
|
|
4
4
|
import { executionsElsewhere, executionsOn, listExecutions, reportedExecutions, reportedOn, transactionOfEdge, } from './rule-test-execution.js';
|
|
@@ -19,7 +19,8 @@ const applicabilityCalls = {
|
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Runs a rule in `analytics` against the traffic: every transaction of the
|
|
22
|
-
* format recorded once, conforming, unless traffic is handed in.
|
|
22
|
+
* format recorded once, conforming, unless traffic is handed in. A `default`
|
|
23
|
+
* transaction declares no status to answer with, so it is not recorded.
|
|
23
24
|
*
|
|
24
25
|
* The list is the recordings in traffic order, each on the transaction of the
|
|
25
26
|
* format it matches, then the transactions that were never recorded, then the
|
|
@@ -27,12 +28,15 @@ const applicabilityCalls = {
|
|
|
27
28
|
* located on a recording's label takes the place of the transaction that
|
|
28
29
|
* recording matched and keeps the label as its location. A recording that
|
|
29
30
|
* matches no transaction has no entry of its own: what the engine reports on
|
|
30
|
-
* it, it locates on
|
|
31
|
+
* it, it locates on the operation's request node when only the response is
|
|
32
|
+
* undocumented, otherwise on a free string.
|
|
31
33
|
*/
|
|
32
34
|
export async function runAnalyze(underTest, format, handedIn) {
|
|
33
35
|
const transactions = format.getThymianHttpTransactions();
|
|
34
36
|
const traffic = handedIn ??
|
|
35
|
-
transactions
|
|
37
|
+
transactions
|
|
38
|
+
.filter(({ thymianRes }) => !isDefaultResponse(thymianRes))
|
|
39
|
+
.map(({ transactionId }) => recorded(format, transactionId));
|
|
36
40
|
// Per recording, in traffic order: the id of the transaction it matches.
|
|
37
41
|
const matched = traffic.map((pair) => matchedTransaction(format, pair));
|
|
38
42
|
// The analyzer locates what a rule returns about a recorded pair on the
|
package/dist/run-analyze.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-analyze.js","sourceRoot":"","sources":["../src/run-analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,UAAU,EAEV,QAAQ,GAET,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAqB,MAAM,eAAe,CAAC;AAC5D,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,UAAU,EAGV,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,sBAAsB,EACtB,oBAAoB,GAErB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;AAEhC;;;GAGG;AACH,MAAM,kBAAkB,GAAuB;IAC7C,OAAO,EAAE,IAAI,GAAG,CAAC;QACf,gCAAgC;QAChC,uCAAuC;QACvC,0BAA0B;QAC1B,kCAAkC;KACnC,CAAC;IACF,UAAU,EAAE,IAAI,GAAG,CAAC,CAAC,4BAA4B,CAAC,CAAC;CACpD,CAAC;AAWF
|
|
1
|
+
{"version":3,"file":"run-analyze.js","sourceRoot":"","sources":["../src/run-analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EAEV,QAAQ,GAET,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAqB,MAAM,eAAe,CAAC;AAC5D,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,kBAAkB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AACjB,CAAC;AAED;;;;GAIG;AACH,SAAS,kBAAkB,CACzB,MAAqB,EACrB,EAAE,OAAO,EAAE,QAAQ,EAAgB;IAEnC,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/dist/run-test.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-test.d.ts","sourceRoot":"","sources":["../src/run-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"run-test.d.ts","sourceRoot":"","sources":["../src/run-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EAgBjB,KAAK,aAAa,EAEnB,MAAM,eAAe,CAAC;AAYvB,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,UAAU,EAAE,YAAY,CAAC;IACzB,iCAAiC;IACjC,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,KAAK,EAAE,YAAY,KAChB,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAE1C;;;;GAIG;AACH,wBAAsB,OAAO,CAC3B,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,OAAwC,GAChD,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAmH9B"}
|
package/dist/run-test.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHttpTestContext, isGroupedHttpTestCaseStep, isRuleViolationGroupLocation, NoopLogger, resolveViolationLocation, runRules, } from '@thymian/core';
|
|
1
|
+
import { createHttpTestContext, isGroupedHttpTestCaseStep, isRuleLevelNotApplicable, isRuleViolationGroupLocation, isStatusWithoutSeverity, NoopLogger, resolveViolationLocation, runRules, } from '@thymian/core';
|
|
2
2
|
import { exampleRequestSampler, identityHookRunner, } from '@thymian/core-testing';
|
|
3
3
|
import { createRuns, HttpTestApiContext, } from '@thymian/plugin-http-tester';
|
|
4
4
|
import { conformingResponse } from './conforming-response.js';
|
|
@@ -56,7 +56,9 @@ export async function runTest(underTest, format, respond = ({ conforming }) => c
|
|
|
56
56
|
severity: declaredSeverity,
|
|
57
57
|
}
|
|
58
58
|
: {}),
|
|
59
|
-
...(status.kind
|
|
59
|
+
...(isStatusWithoutSeverity(status.kind) &&
|
|
60
|
+
'reason' in status &&
|
|
61
|
+
status.reason !== undefined
|
|
60
62
|
? { reason: status.reason }
|
|
61
63
|
: {}),
|
|
62
64
|
// The tester repeats a violation as a `rule-violation` finding on its
|
|
@@ -66,11 +68,13 @@ export async function runTest(underTest, format, respond = ({ conforming }) => c
|
|
|
66
68
|
.filter(({ kind }) => kind !== 'rule-violation'),
|
|
67
69
|
};
|
|
68
70
|
};
|
|
69
|
-
|
|
71
|
+
// A rule that applied to nothing gets one execution of its own, on no
|
|
72
|
+
// transaction; the list below already says `notApplicable` for each of them.
|
|
73
|
+
const executions = (run?.runType === 'test' ? (run.executions ?? []) : []).filter((execution) => !isRuleLevelNotApplicable(execution));
|
|
70
74
|
// The tester reports one execution per test case, in the order it ran them.
|
|
71
|
-
const groups = (result[rule.meta.name]?.diagnostics ?? []).flatMap(({ testResult, placements }) => testResult.cases.map((testCase, testCaseIndex) => groupOf(testCase, placements
|
|
75
|
+
const groups = (result[rule.meta.name]?.diagnostics?.calls ?? []).flatMap(({ testResult, placements, rejectedCases = [] }) => testResult.cases.map((testCase, testCaseIndex) => groupOf(testCase, placements
|
|
72
76
|
.filter((placement) => placement.testCaseIndex === testCaseIndex)
|
|
73
|
-
.map((placement) => placement.result))));
|
|
77
|
+
.map((placement) => placement.result), rejectedCases.find((rejected) => rejected.testCaseIndex === testCaseIndex)?.rejected ?? [])));
|
|
74
78
|
const reported = executions.flatMap((execution, index) => {
|
|
75
79
|
const group = groups[index];
|
|
76
80
|
return group === undefined
|
|
@@ -82,13 +86,26 @@ export async function runTest(underTest, format, respond = ({ conforming }) => c
|
|
|
82
86
|
return listExecutions(format, reported, () => false);
|
|
83
87
|
}
|
|
84
88
|
/** The group of a test case of a grouped rule; none for any other case. */
|
|
85
|
-
function groupOf({ steps }, returned) {
|
|
89
|
+
function groupOf({ steps }, returned, rejected) {
|
|
86
90
|
const [step] = steps;
|
|
87
91
|
if (step === undefined || !isGroupedHttpTestCaseStep(step)) {
|
|
88
92
|
return undefined;
|
|
89
93
|
}
|
|
94
|
+
// `rejected` indexes the transactions of the step, members without a
|
|
95
|
+
// source included.
|
|
90
96
|
return {
|
|
91
|
-
members: step.transactions.flatMap(({ source }) =>
|
|
97
|
+
members: step.transactions.flatMap(({ source }, transactionIndex) => {
|
|
98
|
+
if (source === undefined) {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
const rejection = rejected.find((pair) => pair.transactionIndex === transactionIndex)?.reason;
|
|
102
|
+
return [
|
|
103
|
+
{
|
|
104
|
+
transaction: source,
|
|
105
|
+
...(rejection !== undefined ? { rejection } : {}),
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
}),
|
|
92
109
|
returned,
|
|
93
110
|
};
|
|
94
111
|
}
|
|
@@ -96,9 +113,10 @@ function groupOf({ steps }, returned) {
|
|
|
96
113
|
* The tester reports a group as one execution, on the group key: failed when
|
|
97
114
|
* the rule returned a violation on any of it. Who is at fault is in what the
|
|
98
115
|
* rule returned, read as core's report builder reads it in `static`: a member
|
|
99
|
-
* it located a violation on, or the group, which is every member. A
|
|
100
|
-
*
|
|
101
|
-
* the
|
|
116
|
+
* it located a violation on, or the group, which is every judged member. A
|
|
117
|
+
* member the live re-check rejected is `notApplicable`, with its own reason
|
|
118
|
+
* (ADR-0030). A judged member the rule returned nothing on has the status of
|
|
119
|
+
* the execution, and where that is the failure of another member, it passed.
|
|
102
120
|
*/
|
|
103
121
|
function executionsOnMembers({ members, returned }, { status }, underTest, format) {
|
|
104
122
|
const said = reportedExecutions({
|
|
@@ -114,8 +132,12 @@ function executionsOnMembers({ members, returned }, { status }, underTest, forma
|
|
|
114
132
|
}
|
|
115
133
|
: {};
|
|
116
134
|
return [
|
|
117
|
-
...members.flatMap((
|
|
118
|
-
|
|
135
|
+
...members.flatMap(({ transaction, rejection }) => rejection !== undefined
|
|
136
|
+
? executionsOn(transaction, said, 'notApplicable').map((execution) => said.includes(execution)
|
|
137
|
+
? execution
|
|
138
|
+
: { ...execution, reason: rejection })
|
|
139
|
+
: executionsOn(transaction, said, 'passed').map((execution) => said.includes(execution) ? execution : { ...execution, ...skipped })),
|
|
140
|
+
...executionsElsewhere(members.map(({ transaction }) => transaction), said),
|
|
119
141
|
];
|
|
120
142
|
}
|
|
121
143
|
/**
|
package/dist/run-test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-test.js","sourceRoot":"","sources":["../src/run-test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAMrB,yBAAyB,EACzB,4BAA4B,EAC5B,UAAU,EACV,wBAAwB,EAKxB,QAAQ,GAIT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,UAAU,EACV,kBAAkB,GAEnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,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C,CAAC,EAAE,QAAQ,CAAC;IAEpC,IAAI,QAAQ,EAAE,IAAI,KAAK,eAAe,EAAE,CAAC;QACvC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;QACrD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IAC7C,CAAC;IAED,IAAI,QAAQ,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;IAED,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thymian/rules-testing",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Test a Thymian rule through the real engine of each validation context it declares",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"bugs": {
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"!**/*.tsbuildinfo"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@thymian/core": "0.4.
|
|
46
|
-
"@thymian/core-testing": "0.4.
|
|
47
|
-
"@thymian/plugin-http-analyzer": "0.4.
|
|
48
|
-
"@thymian/plugin-http-linter": "0.4.
|
|
49
|
-
"@thymian/plugin-http-tester": "0.4.
|
|
45
|
+
"@thymian/core": "0.4.1",
|
|
46
|
+
"@thymian/core-testing": "0.4.1",
|
|
47
|
+
"@thymian/plugin-http-analyzer": "0.4.1",
|
|
48
|
+
"@thymian/plugin-http-linter": "0.4.1",
|
|
49
|
+
"@thymian/plugin-http-tester": "0.4.1",
|
|
50
50
|
"tslib": "^2.3.0"
|
|
51
51
|
}
|
|
52
52
|
}
|