slicetest 0.3.0 → 0.5.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 +211 -7
- package/dist/auth.d.ts +45 -0
- package/dist/auth.js +128 -0
- package/dist/ci.d.ts +29 -0
- package/dist/ci.js +57 -0
- package/dist/cli.js +31 -3
- package/dist/config.d.ts +25 -2
- package/dist/config.js +25 -4
- package/dist/db.d.ts +26 -0
- package/dist/db.js +50 -0
- package/dist/doctor.d.ts +22 -0
- package/dist/doctor.js +190 -0
- package/dist/drivers/driver.d.ts +29 -0
- package/dist/drivers/index.js +2 -0
- package/dist/drivers/mysql.d.ts +2 -1
- package/dist/drivers/mysql.js +38 -0
- package/dist/drivers/postgres.d.ts +2 -1
- package/dist/drivers/postgres.js +28 -0
- package/dist/drivers/sqlite.d.ts +24 -0
- package/dist/drivers/sqlite.js +255 -0
- package/dist/factory.d.ts +21 -0
- package/dist/factory.js +129 -0
- package/dist/gen.d.ts +1 -0
- package/dist/gen.js +9 -4
- package/dist/global-setup.js +24 -3
- package/dist/http.d.ts +13 -0
- package/dist/http.js +24 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +2 -0
- package/dist/init.js +123 -5
- package/dist/mail.d.ts +58 -0
- package/dist/mail.js +299 -0
- package/dist/matchers.d.ts +4 -0
- package/dist/matchers.js +33 -0
- package/dist/openapi.d.ts +9 -0
- package/dist/openapi.js +29 -1
- package/dist/provided.d.ts +1 -0
- package/dist/query-log.d.ts +49 -0
- package/dist/query-log.js +261 -0
- package/dist/record-cli.d.ts +6 -0
- package/dist/record-cli.js +93 -0
- package/dist/record-session.d.ts +1 -0
- package/dist/record-session.js +10 -0
- package/dist/record.d.ts +46 -0
- package/dist/record.js +201 -0
- package/dist/runtime.d.ts +10 -0
- package/dist/runtime.js +62 -3
- package/dist/stub.d.ts +32 -0
- package/dist/stub.js +87 -0
- package/dist/trace.d.ts +9 -1
- package/dist/trace.js +3 -1
- package/dist/vitest.js +5 -2
- package/dist/webhook.d.ts +40 -0
- package/dist/webhook.js +52 -0
- package/dist/yaml-runtime.d.ts +1 -0
- package/dist/yaml-runtime.js +92 -15
- package/dist/yaml.d.ts +59 -1
- package/dist/yaml.js +88 -5
- package/package.json +11 -4
- package/schema/scenario.schema.json +329 -1
|
@@ -180,6 +180,86 @@
|
|
|
180
180
|
"follow": {
|
|
181
181
|
"type": "boolean"
|
|
182
182
|
},
|
|
183
|
+
"auth": {
|
|
184
|
+
"description": "Send Authorization: Bearer with a token from the auth issuer: true, or the token's claims",
|
|
185
|
+
"oneOf": [
|
|
186
|
+
{
|
|
187
|
+
"const": true
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"type": "object"
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
"webhook": {
|
|
195
|
+
"type": "object",
|
|
196
|
+
"description": "Sign the body as this provider delivers webhooks",
|
|
197
|
+
"required": [
|
|
198
|
+
"provider",
|
|
199
|
+
"secret"
|
|
200
|
+
],
|
|
201
|
+
"additionalProperties": false,
|
|
202
|
+
"properties": {
|
|
203
|
+
"provider": {
|
|
204
|
+
"oneOf": [
|
|
205
|
+
{
|
|
206
|
+
"enum": [
|
|
207
|
+
"stripe",
|
|
208
|
+
"github",
|
|
209
|
+
"slack",
|
|
210
|
+
"shopify",
|
|
211
|
+
"standard"
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"type": "object",
|
|
216
|
+
"required": [
|
|
217
|
+
"header"
|
|
218
|
+
],
|
|
219
|
+
"additionalProperties": false,
|
|
220
|
+
"properties": {
|
|
221
|
+
"header": {
|
|
222
|
+
"type": "string"
|
|
223
|
+
},
|
|
224
|
+
"algorithm": {
|
|
225
|
+
"type": "string"
|
|
226
|
+
},
|
|
227
|
+
"encoding": {
|
|
228
|
+
"enum": [
|
|
229
|
+
"hex",
|
|
230
|
+
"base64"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"prefix": {
|
|
234
|
+
"type": "string"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
"secret": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"description": "The signing secret the app is configured with"
|
|
243
|
+
},
|
|
244
|
+
"event": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"description": "Event type, e.g. X-GitHub-Event"
|
|
247
|
+
},
|
|
248
|
+
"stale": {
|
|
249
|
+
"type": "boolean",
|
|
250
|
+
"description": "Signed ten minutes ago"
|
|
251
|
+
},
|
|
252
|
+
"invalidSignature": {
|
|
253
|
+
"type": "boolean",
|
|
254
|
+
"description": "Signed with a different secret"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"concurrency": {
|
|
259
|
+
"type": "integer",
|
|
260
|
+
"minimum": 1,
|
|
261
|
+
"description": "Send the request this many times at once, to provoke races. `expect` applies to every response"
|
|
262
|
+
},
|
|
183
263
|
"expect": {
|
|
184
264
|
"type": "object",
|
|
185
265
|
"additionalProperties": false,
|
|
@@ -196,7 +276,23 @@
|
|
|
196
276
|
"json": {
|
|
197
277
|
"description": "Subset of the response JSON"
|
|
198
278
|
},
|
|
199
|
-
"text": {}
|
|
279
|
+
"text": {},
|
|
280
|
+
"statuses": {
|
|
281
|
+
"type": "object",
|
|
282
|
+
"propertyNames": {
|
|
283
|
+
"pattern": "^\\d{3}$"
|
|
284
|
+
},
|
|
285
|
+
"additionalProperties": {
|
|
286
|
+
"type": "integer",
|
|
287
|
+
"minimum": 0
|
|
288
|
+
},
|
|
289
|
+
"description": "With `concurrency`: how many responses have each status, e.g. { 201: 1, 409: 9 }"
|
|
290
|
+
},
|
|
291
|
+
"queries": {
|
|
292
|
+
"type": "integer",
|
|
293
|
+
"minimum": 0,
|
|
294
|
+
"description": "At most this many SQL statements for this request, not counting BEGIN/COMMIT (needs db.queries)"
|
|
295
|
+
}
|
|
200
296
|
}
|
|
201
297
|
},
|
|
202
298
|
"capture": {
|
|
@@ -239,6 +335,106 @@
|
|
|
239
335
|
}
|
|
240
336
|
}
|
|
241
337
|
},
|
|
338
|
+
{
|
|
339
|
+
"type": "object",
|
|
340
|
+
"required": [
|
|
341
|
+
"make"
|
|
342
|
+
],
|
|
343
|
+
"additionalProperties": false,
|
|
344
|
+
"properties": {
|
|
345
|
+
"make": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"description": "Table to make rows in: required columns and parent rows are filled from the schema"
|
|
348
|
+
},
|
|
349
|
+
"name": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"description": "Label shown when this step fails"
|
|
352
|
+
},
|
|
353
|
+
"rows": {
|
|
354
|
+
"type": [
|
|
355
|
+
"object",
|
|
356
|
+
"array"
|
|
357
|
+
],
|
|
358
|
+
"description": "Columns to set: a mapping, or a list of mappings for several rows"
|
|
359
|
+
},
|
|
360
|
+
"count": {
|
|
361
|
+
"type": "integer",
|
|
362
|
+
"minimum": 1,
|
|
363
|
+
"description": "Make this many rows, each with `rows`"
|
|
364
|
+
},
|
|
365
|
+
"capture": {
|
|
366
|
+
"type": "object",
|
|
367
|
+
"description": "Save values as variables for later steps, e.g. { orderId: row.id }",
|
|
368
|
+
"additionalProperties": {
|
|
369
|
+
"type": "string"
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"type": "object",
|
|
376
|
+
"required": [
|
|
377
|
+
"chaos"
|
|
378
|
+
],
|
|
379
|
+
"additionalProperties": false,
|
|
380
|
+
"properties": {
|
|
381
|
+
"chaos": {
|
|
382
|
+
"type": "string",
|
|
383
|
+
"description": "Stub to inject faults into, for the rest of the scenario"
|
|
384
|
+
},
|
|
385
|
+
"name": {
|
|
386
|
+
"type": "string",
|
|
387
|
+
"description": "Label shown when this step fails"
|
|
388
|
+
},
|
|
389
|
+
"failFirst": {
|
|
390
|
+
"type": "integer",
|
|
391
|
+
"minimum": 0,
|
|
392
|
+
"description": "Fail the first n calls, then answer normally"
|
|
393
|
+
},
|
|
394
|
+
"errorRate": {
|
|
395
|
+
"type": "number",
|
|
396
|
+
"minimum": 0,
|
|
397
|
+
"maximum": 1,
|
|
398
|
+
"description": "Share of calls answered with an error status"
|
|
399
|
+
},
|
|
400
|
+
"statuses": {
|
|
401
|
+
"type": "array",
|
|
402
|
+
"minItems": 1,
|
|
403
|
+
"items": {
|
|
404
|
+
"type": "integer",
|
|
405
|
+
"minimum": 400,
|
|
406
|
+
"maximum": 599
|
|
407
|
+
},
|
|
408
|
+
"description": "Error statuses to pick from (default 500, 502, 503)"
|
|
409
|
+
},
|
|
410
|
+
"networkErrorRate": {
|
|
411
|
+
"type": "number",
|
|
412
|
+
"minimum": 0,
|
|
413
|
+
"maximum": 1,
|
|
414
|
+
"description": "Share of calls whose connection is dropped"
|
|
415
|
+
},
|
|
416
|
+
"latency": {
|
|
417
|
+
"oneOf": [
|
|
418
|
+
{
|
|
419
|
+
"type": "number"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"type": "array",
|
|
423
|
+
"items": {
|
|
424
|
+
"type": "number"
|
|
425
|
+
},
|
|
426
|
+
"minItems": 2,
|
|
427
|
+
"maxItems": 2
|
|
428
|
+
}
|
|
429
|
+
],
|
|
430
|
+
"description": "Extra delay in ms, or [min, max]"
|
|
431
|
+
},
|
|
432
|
+
"seed": {
|
|
433
|
+
"type": "integer",
|
|
434
|
+
"description": "Seed for the random faults"
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
},
|
|
242
438
|
{
|
|
243
439
|
"type": "object",
|
|
244
440
|
"required": [
|
|
@@ -525,6 +721,138 @@
|
|
|
525
721
|
"description": "Label shown when this step fails"
|
|
526
722
|
}
|
|
527
723
|
}
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"type": "object",
|
|
727
|
+
"required": [
|
|
728
|
+
"mail"
|
|
729
|
+
],
|
|
730
|
+
"additionalProperties": false,
|
|
731
|
+
"properties": {
|
|
732
|
+
"mail": {
|
|
733
|
+
"type": "object",
|
|
734
|
+
"additionalProperties": false,
|
|
735
|
+
"description": "The app sent mail matching these fields (needs `mail: true` in the config). to/from are exact addresses; subject/text/html are substrings. {} matches any message",
|
|
736
|
+
"properties": {
|
|
737
|
+
"to": {
|
|
738
|
+
"oneOf": [
|
|
739
|
+
{
|
|
740
|
+
"type": "string"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"type": "object",
|
|
744
|
+
"required": [
|
|
745
|
+
"$regex"
|
|
746
|
+
],
|
|
747
|
+
"additionalProperties": false,
|
|
748
|
+
"properties": {
|
|
749
|
+
"$regex": {
|
|
750
|
+
"type": "string"
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
]
|
|
755
|
+
},
|
|
756
|
+
"from": {
|
|
757
|
+
"oneOf": [
|
|
758
|
+
{
|
|
759
|
+
"type": "string"
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"type": "object",
|
|
763
|
+
"required": [
|
|
764
|
+
"$regex"
|
|
765
|
+
],
|
|
766
|
+
"additionalProperties": false,
|
|
767
|
+
"properties": {
|
|
768
|
+
"$regex": {
|
|
769
|
+
"type": "string"
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
]
|
|
774
|
+
},
|
|
775
|
+
"subject": {
|
|
776
|
+
"oneOf": [
|
|
777
|
+
{
|
|
778
|
+
"type": "string"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"type": "object",
|
|
782
|
+
"required": [
|
|
783
|
+
"$regex"
|
|
784
|
+
],
|
|
785
|
+
"additionalProperties": false,
|
|
786
|
+
"properties": {
|
|
787
|
+
"$regex": {
|
|
788
|
+
"type": "string"
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
]
|
|
793
|
+
},
|
|
794
|
+
"text": {
|
|
795
|
+
"oneOf": [
|
|
796
|
+
{
|
|
797
|
+
"type": "string"
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
"type": "object",
|
|
801
|
+
"required": [
|
|
802
|
+
"$regex"
|
|
803
|
+
],
|
|
804
|
+
"additionalProperties": false,
|
|
805
|
+
"properties": {
|
|
806
|
+
"$regex": {
|
|
807
|
+
"type": "string"
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
]
|
|
812
|
+
},
|
|
813
|
+
"html": {
|
|
814
|
+
"oneOf": [
|
|
815
|
+
{
|
|
816
|
+
"type": "string"
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
"type": "object",
|
|
820
|
+
"required": [
|
|
821
|
+
"$regex"
|
|
822
|
+
],
|
|
823
|
+
"additionalProperties": false,
|
|
824
|
+
"properties": {
|
|
825
|
+
"$regex": {
|
|
826
|
+
"type": "string"
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
]
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
"times": {
|
|
835
|
+
"type": "integer",
|
|
836
|
+
"minimum": 0,
|
|
837
|
+
"description": "Exact number of matching messages. Default: at least one"
|
|
838
|
+
},
|
|
839
|
+
"within": {
|
|
840
|
+
"type": "integer",
|
|
841
|
+
"minimum": 1,
|
|
842
|
+
"description": "Milliseconds to wait. Default 5000"
|
|
843
|
+
},
|
|
844
|
+
"capture": {
|
|
845
|
+
"type": "object",
|
|
846
|
+
"additionalProperties": {
|
|
847
|
+
"type": "string"
|
|
848
|
+
},
|
|
849
|
+
"description": "Values of the last matching message: subject, text, html, from, to.0, links.0"
|
|
850
|
+
},
|
|
851
|
+
"name": {
|
|
852
|
+
"type": "string",
|
|
853
|
+
"description": "Label shown when this step fails"
|
|
854
|
+
}
|
|
855
|
+
}
|
|
528
856
|
}
|
|
529
857
|
]
|
|
530
858
|
},
|