slicetest 0.6.0 → 0.7.0
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 +110 -15
- package/dist/app.js +37 -9
- package/dist/cli.js +46 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.js +10 -0
- package/dist/connection.d.ts +5 -0
- package/dist/connection.js +31 -0
- package/dist/diagram.d.ts +13 -0
- package/dist/diagram.js +89 -0
- package/dist/global-setup.js +45 -4
- package/dist/graphql.d.ts +34 -0
- package/dist/graphql.js +56 -0
- package/dist/har.d.ts +49 -0
- package/dist/har.js +107 -0
- package/dist/http.d.ts +12 -0
- package/dist/http.js +71 -16
- package/dist/index.d.ts +2 -1
- package/dist/init.js +184 -15
- package/dist/matchers.d.ts +9 -0
- package/dist/matchers.js +47 -1
- package/dist/openapi.d.ts +21 -0
- package/dist/openapi.js +32 -1
- package/dist/provided.d.ts +1 -0
- package/dist/recording.d.ts +1 -1
- package/dist/recording.js +2 -2
- package/dist/runtime.d.ts +12 -5
- package/dist/runtime.js +77 -22
- package/dist/scenario.js +3 -0
- package/dist/schema.d.ts +5 -0
- package/dist/schema.js +73 -0
- package/dist/stub.d.ts +41 -0
- package/dist/stub.js +187 -3
- package/dist/timeline.d.ts +9 -0
- package/dist/timeline.js +6 -0
- package/dist/yaml-runtime.js +67 -20
- package/dist/yaml.d.ts +40 -5
- package/dist/yaml.js +102 -15
- package/package.json +2 -1
- package/schema/scenario.schema.json +279 -12
|
@@ -15,6 +15,41 @@
|
|
|
15
15
|
"$ref": "#/$defs/step"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
+
"define": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"description": "Named step lists that `use:` steps run. A list of steps, or { params, steps } for values given with `with:`",
|
|
21
|
+
"additionalProperties": {
|
|
22
|
+
"oneOf": [
|
|
23
|
+
{
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"$ref": "#/$defs/step"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "object",
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"required": [
|
|
33
|
+
"steps"
|
|
34
|
+
],
|
|
35
|
+
"properties": {
|
|
36
|
+
"params": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"steps": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"$ref": "#/$defs/step"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
18
53
|
"scenarios": {
|
|
19
54
|
"type": "array",
|
|
20
55
|
"minItems": 1,
|
|
@@ -62,8 +97,7 @@
|
|
|
62
97
|
{
|
|
63
98
|
"type": "object",
|
|
64
99
|
"required": [
|
|
65
|
-
"stub"
|
|
66
|
-
"on"
|
|
100
|
+
"stub"
|
|
67
101
|
],
|
|
68
102
|
"additionalProperties": false,
|
|
69
103
|
"properties": {
|
|
@@ -93,7 +127,10 @@
|
|
|
93
127
|
"json": {
|
|
94
128
|
"description": "Subset of the request JSON"
|
|
95
129
|
},
|
|
96
|
-
"body": {}
|
|
130
|
+
"body": {},
|
|
131
|
+
"variables": {
|
|
132
|
+
"description": "Subset of the GraphQL variables (with `graphql`)"
|
|
133
|
+
}
|
|
97
134
|
}
|
|
98
135
|
},
|
|
99
136
|
"reply": {
|
|
@@ -131,12 +168,60 @@
|
|
|
131
168
|
}
|
|
132
169
|
}
|
|
133
170
|
}
|
|
171
|
+
},
|
|
172
|
+
"data": {
|
|
173
|
+
"description": "GraphQL `data` (with `graphql`): the reply's body is { data, errors }"
|
|
174
|
+
},
|
|
175
|
+
"errors": {
|
|
176
|
+
"type": "array",
|
|
177
|
+
"description": "GraphQL errors (with `graphql`): messages or { message, path, extensions }",
|
|
178
|
+
"items": {
|
|
179
|
+
"oneOf": [
|
|
180
|
+
{
|
|
181
|
+
"type": "string"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"type": "object",
|
|
185
|
+
"required": [
|
|
186
|
+
"message"
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
134
191
|
}
|
|
135
192
|
},
|
|
136
193
|
"not": {
|
|
137
|
-
"
|
|
138
|
-
|
|
139
|
-
|
|
194
|
+
"anyOf": [
|
|
195
|
+
{
|
|
196
|
+
"required": [
|
|
197
|
+
"body",
|
|
198
|
+
"sse"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"required": [
|
|
203
|
+
"body",
|
|
204
|
+
"data"
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"required": [
|
|
209
|
+
"body",
|
|
210
|
+
"errors"
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"required": [
|
|
215
|
+
"sse",
|
|
216
|
+
"data"
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"required": [
|
|
221
|
+
"sse",
|
|
222
|
+
"errors"
|
|
223
|
+
]
|
|
224
|
+
}
|
|
140
225
|
]
|
|
141
226
|
}
|
|
142
227
|
},
|
|
@@ -177,12 +262,60 @@
|
|
|
177
262
|
}
|
|
178
263
|
}
|
|
179
264
|
}
|
|
265
|
+
},
|
|
266
|
+
"data": {
|
|
267
|
+
"description": "GraphQL `data` (with `graphql`): the reply's body is { data, errors }"
|
|
268
|
+
},
|
|
269
|
+
"errors": {
|
|
270
|
+
"type": "array",
|
|
271
|
+
"description": "GraphQL errors (with `graphql`): messages or { message, path, extensions }",
|
|
272
|
+
"items": {
|
|
273
|
+
"oneOf": [
|
|
274
|
+
{
|
|
275
|
+
"type": "string"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"type": "object",
|
|
279
|
+
"required": [
|
|
280
|
+
"message"
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
}
|
|
180
285
|
}
|
|
181
286
|
},
|
|
182
287
|
"not": {
|
|
183
|
-
"
|
|
184
|
-
|
|
185
|
-
|
|
288
|
+
"anyOf": [
|
|
289
|
+
{
|
|
290
|
+
"required": [
|
|
291
|
+
"body",
|
|
292
|
+
"sse"
|
|
293
|
+
]
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"required": [
|
|
297
|
+
"body",
|
|
298
|
+
"data"
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"required": [
|
|
303
|
+
"body",
|
|
304
|
+
"errors"
|
|
305
|
+
]
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"required": [
|
|
309
|
+
"sse",
|
|
310
|
+
"data"
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"required": [
|
|
315
|
+
"sse",
|
|
316
|
+
"errors"
|
|
317
|
+
]
|
|
318
|
+
}
|
|
186
319
|
]
|
|
187
320
|
}
|
|
188
321
|
},
|
|
@@ -198,8 +331,38 @@
|
|
|
198
331
|
"delay": {
|
|
199
332
|
"type": "integer",
|
|
200
333
|
"minimum": 0
|
|
334
|
+
},
|
|
335
|
+
"graphql": {
|
|
336
|
+
"type": "string",
|
|
337
|
+
"description": "A GraphQL operation (its operationName, or the name in the document), instead of METHOD /path. Matches POST and GET GraphQL requests to any path"
|
|
338
|
+
},
|
|
339
|
+
"optional": {
|
|
340
|
+
"type": "boolean",
|
|
341
|
+
"description": "The app may not call this route: strictStubs doesn't report it as unused"
|
|
201
342
|
}
|
|
202
|
-
}
|
|
343
|
+
},
|
|
344
|
+
"oneOf": [
|
|
345
|
+
{
|
|
346
|
+
"required": [
|
|
347
|
+
"on"
|
|
348
|
+
],
|
|
349
|
+
"not": {
|
|
350
|
+
"required": [
|
|
351
|
+
"graphql"
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"required": [
|
|
357
|
+
"graphql"
|
|
358
|
+
],
|
|
359
|
+
"not": {
|
|
360
|
+
"required": [
|
|
361
|
+
"on"
|
|
362
|
+
]
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
]
|
|
203
366
|
},
|
|
204
367
|
{
|
|
205
368
|
"type": "object",
|
|
@@ -344,6 +507,17 @@
|
|
|
344
507
|
"type": "integer",
|
|
345
508
|
"minimum": 0,
|
|
346
509
|
"description": "At most this many SQL statements for this request, not counting BEGIN/COMMIT (needs db.queries)"
|
|
510
|
+
},
|
|
511
|
+
"schema": {
|
|
512
|
+
"description": "A JSON Schema the response JSON must match: inline, or a file relative to this one with an optional pointer, e.g. ../openapi.yaml#/components/schemas/Poll",
|
|
513
|
+
"oneOf": [
|
|
514
|
+
{
|
|
515
|
+
"type": "string"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"type": "object"
|
|
519
|
+
}
|
|
520
|
+
]
|
|
347
521
|
}
|
|
348
522
|
}
|
|
349
523
|
},
|
|
@@ -353,7 +527,55 @@
|
|
|
353
527
|
"additionalProperties": {
|
|
354
528
|
"type": "string"
|
|
355
529
|
}
|
|
530
|
+
},
|
|
531
|
+
"graphql": {
|
|
532
|
+
"description": "Send a GraphQL operation as the JSON body: the query, or { query, variables, operationName }. A response with `errors` fails the step unless `expect.json` names `errors`",
|
|
533
|
+
"oneOf": [
|
|
534
|
+
{
|
|
535
|
+
"type": "string"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"type": "object",
|
|
539
|
+
"required": [
|
|
540
|
+
"query"
|
|
541
|
+
],
|
|
542
|
+
"additionalProperties": false,
|
|
543
|
+
"properties": {
|
|
544
|
+
"query": {
|
|
545
|
+
"type": "string"
|
|
546
|
+
},
|
|
547
|
+
"variables": {
|
|
548
|
+
"type": "object"
|
|
549
|
+
},
|
|
550
|
+
"operationName": {
|
|
551
|
+
"type": "string"
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
]
|
|
356
556
|
}
|
|
557
|
+
},
|
|
558
|
+
"not": {
|
|
559
|
+
"anyOf": [
|
|
560
|
+
{
|
|
561
|
+
"required": [
|
|
562
|
+
"graphql",
|
|
563
|
+
"json"
|
|
564
|
+
]
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"required": [
|
|
568
|
+
"graphql",
|
|
569
|
+
"form"
|
|
570
|
+
]
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"required": [
|
|
574
|
+
"graphql",
|
|
575
|
+
"body"
|
|
576
|
+
]
|
|
577
|
+
}
|
|
578
|
+
]
|
|
357
579
|
}
|
|
358
580
|
},
|
|
359
581
|
{
|
|
@@ -432,7 +654,18 @@
|
|
|
432
654
|
"json": {
|
|
433
655
|
"description": "Subset of the response JSON"
|
|
434
656
|
},
|
|
435
|
-
"text": {}
|
|
657
|
+
"text": {},
|
|
658
|
+
"schema": {
|
|
659
|
+
"description": "A JSON Schema the response JSON must match: inline, or a file relative to this one with an optional pointer, e.g. ../openapi.yaml#/components/schemas/Poll",
|
|
660
|
+
"oneOf": [
|
|
661
|
+
{
|
|
662
|
+
"type": "string"
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
"type": "object"
|
|
666
|
+
}
|
|
667
|
+
]
|
|
668
|
+
}
|
|
436
669
|
}
|
|
437
670
|
},
|
|
438
671
|
"capture": {
|
|
@@ -707,7 +940,10 @@
|
|
|
707
940
|
"json": {
|
|
708
941
|
"description": "Subset of the request JSON"
|
|
709
942
|
},
|
|
710
|
-
"body": {}
|
|
943
|
+
"body": {},
|
|
944
|
+
"variables": {
|
|
945
|
+
"description": "Subset of the GraphQL variables (with `graphql`)"
|
|
946
|
+
}
|
|
711
947
|
}
|
|
712
948
|
},
|
|
713
949
|
"times": {
|
|
@@ -719,7 +955,17 @@
|
|
|
719
955
|
"type": "integer",
|
|
720
956
|
"minimum": 1,
|
|
721
957
|
"description": "Retry this step for up to this many milliseconds, for effects the app applies asynchronously"
|
|
958
|
+
},
|
|
959
|
+
"graphql": {
|
|
960
|
+
"type": "string",
|
|
961
|
+
"description": "A GraphQL operation (its operationName, or the name in the document), instead of METHOD /path. Matches POST and GET GraphQL requests to any path"
|
|
722
962
|
}
|
|
963
|
+
},
|
|
964
|
+
"not": {
|
|
965
|
+
"required": [
|
|
966
|
+
"call",
|
|
967
|
+
"graphql"
|
|
968
|
+
]
|
|
723
969
|
}
|
|
724
970
|
},
|
|
725
971
|
{
|
|
@@ -993,6 +1239,27 @@
|
|
|
993
1239
|
"description": "Label shown when this step fails"
|
|
994
1240
|
}
|
|
995
1241
|
}
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
"type": "object",
|
|
1245
|
+
"required": [
|
|
1246
|
+
"use"
|
|
1247
|
+
],
|
|
1248
|
+
"additionalProperties": false,
|
|
1249
|
+
"properties": {
|
|
1250
|
+
"use": {
|
|
1251
|
+
"type": "string",
|
|
1252
|
+
"description": "Run the steps of a `define:` entry; what they capture is visible afterwards"
|
|
1253
|
+
},
|
|
1254
|
+
"name": {
|
|
1255
|
+
"type": "string",
|
|
1256
|
+
"description": "Label shown when this step fails"
|
|
1257
|
+
},
|
|
1258
|
+
"with": {
|
|
1259
|
+
"type": "object",
|
|
1260
|
+
"description": "Values for the definition's params, available as {{param}} inside it"
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
996
1263
|
}
|
|
997
1264
|
]
|
|
998
1265
|
},
|