slicetest 0.8.0 → 0.10.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.
Files changed (63) hide show
  1. package/README.md +131 -35
  2. package/dist/app.js +10 -2
  3. package/dist/auth.js +2 -1
  4. package/dist/cli-run.d.ts +53 -0
  5. package/dist/cli-run.js +80 -0
  6. package/dist/cli.js +27 -29
  7. package/dist/config.d.ts +33 -2
  8. package/dist/config.js +121 -2
  9. package/dist/container-runtime.d.ts +4 -0
  10. package/dist/container-runtime.js +16 -0
  11. package/dist/containers.js +4 -3
  12. package/dist/db.d.ts +3 -1
  13. package/dist/db.js +45 -8
  14. package/dist/deadline.d.ts +7 -0
  15. package/dist/deadline.js +24 -0
  16. package/dist/doctor.js +27 -5
  17. package/dist/drivers/driver.d.ts +6 -0
  18. package/dist/drivers/mysql.js +5 -1
  19. package/dist/drivers/postgres.d.ts +2 -0
  20. package/dist/drivers/postgres.js +20 -1
  21. package/dist/exit.d.ts +1 -0
  22. package/dist/exit.js +28 -0
  23. package/dist/form.d.ts +2 -0
  24. package/dist/form.js +62 -9
  25. package/dist/global-setup.js +3 -6
  26. package/dist/har.js +4 -4
  27. package/dist/http.d.ts +38 -4
  28. package/dist/http.js +135 -10
  29. package/dist/init.js +64 -10
  30. package/dist/list.d.ts +1 -0
  31. package/dist/list.js +16 -3
  32. package/dist/mail.d.ts +1 -1
  33. package/dist/mail.js +7 -7
  34. package/dist/matchers.d.ts +18 -6
  35. package/dist/matchers.js +75 -8
  36. package/dist/openapi.d.ts +2 -5
  37. package/dist/openapi.js +146 -20
  38. package/dist/record-cli.js +2 -1
  39. package/dist/record.js +2 -1
  40. package/dist/recording.d.ts +11 -1
  41. package/dist/recording.js +51 -6
  42. package/dist/request-url.d.ts +1 -0
  43. package/dist/request-url.js +5 -0
  44. package/dist/runtime.d.ts +3 -3
  45. package/dist/runtime.js +144 -18
  46. package/dist/scenario.js +11 -2
  47. package/dist/sql-migrations.d.ts +11 -0
  48. package/dist/sql-migrations.js +38 -0
  49. package/dist/stub.d.ts +10 -3
  50. package/dist/stub.js +64 -16
  51. package/dist/vitest.d.ts +4 -0
  52. package/dist/vitest.js +6 -2
  53. package/dist/webhook.d.ts +3 -3
  54. package/dist/webhook.js +10 -2
  55. package/dist/yaml-runtime.d.ts +4 -4
  56. package/dist/yaml-runtime.js +141 -38
  57. package/dist/yaml.d.ts +12 -2
  58. package/dist/yaml.js +47 -4
  59. package/docs/guarantees.md +92 -0
  60. package/docs/state-isolation.md +94 -0
  61. package/package.json +4 -1
  62. package/schema/config.schema.json +675 -0
  63. package/schema/scenario.schema.json +97 -7
@@ -595,7 +595,11 @@
595
595
  "gitlab",
596
596
  "zoom",
597
597
  "twitch",
598
- "twilio"
598
+ "twilio",
599
+ "typeform",
600
+ "notion",
601
+ "bitbucket",
602
+ "intercom"
599
603
  ]
600
604
  },
601
605
  {
@@ -656,10 +660,18 @@
656
660
  "additionalProperties": false,
657
661
  "properties": {
658
662
  "status": {
663
+ "description": "A code (201), a class (\"2xx\") or a list of them ([200, 204]).",
659
664
  "type": [
660
665
  "integer",
661
- "string"
662
- ]
666
+ "string",
667
+ "array"
668
+ ],
669
+ "items": {
670
+ "type": [
671
+ "integer",
672
+ "string"
673
+ ]
674
+ }
663
675
  },
664
676
  "headers": {
665
677
  "type": "object"
@@ -668,16 +680,41 @@
668
680
  "description": "Subset of the response JSON"
669
681
  },
670
682
  "text": {},
683
+ "events": {
684
+ "type": "array",
685
+ "items": {
686
+ "type": "object"
687
+ },
688
+ "description": "Server-sent events of a text/event-stream response that must come in this order, others allowed between: [{ event: message_start }, { data: \"[DONE]\" }]. Each is a subset of { event, data, id }"
689
+ },
690
+ "cookies": {
691
+ "type": "object",
692
+ "description": "Cookies the response sets, by name: attributes as a subset ({ httpOnly: true, sameSite: Lax, value: ... }), or null for one it must not set",
693
+ "additionalProperties": {
694
+ "type": [
695
+ "object",
696
+ "null"
697
+ ]
698
+ }
699
+ },
700
+ "duration": {
701
+ "description": "The response arrived within this many milliseconds, or a matcher on the time: { $lt: 200 }",
702
+ "type": [
703
+ "integer",
704
+ "object"
705
+ ],
706
+ "minimum": 1
707
+ },
671
708
  "statuses": {
672
709
  "type": "object",
673
710
  "propertyNames": {
674
- "pattern": "^\\d{3}$"
711
+ "pattern": "^(\\d{3}|[1-5][xX][xX])$"
675
712
  },
676
713
  "additionalProperties": {
677
714
  "type": "integer",
678
715
  "minimum": 0
679
716
  },
680
- "description": "With `concurrency`: how many responses have each status, e.g. { 201: 1, 409: 9 }"
717
+ "description": "With `concurrency`: how many responses have each status or class, e.g. { 201: 1, 409: 9 } or { 2xx: 1, 4xx: 9 }"
681
718
  },
682
719
  "queries": {
683
720
  "type": "integer",
@@ -899,10 +936,18 @@
899
936
  "additionalProperties": false,
900
937
  "properties": {
901
938
  "status": {
939
+ "description": "A code (201), a class (\"2xx\") or a list of them ([200, 204]).",
902
940
  "type": [
903
941
  "integer",
904
- "string"
905
- ]
942
+ "string",
943
+ "array"
944
+ ],
945
+ "items": {
946
+ "type": [
947
+ "integer",
948
+ "string"
949
+ ]
950
+ }
906
951
  },
907
952
  "headers": {
908
953
  "type": "object"
@@ -911,6 +956,31 @@
911
956
  "description": "Subset of the response JSON"
912
957
  },
913
958
  "text": {},
959
+ "events": {
960
+ "type": "array",
961
+ "items": {
962
+ "type": "object"
963
+ },
964
+ "description": "Server-sent events of a text/event-stream response that must come in this order, others allowed between: [{ event: message_start }, { data: \"[DONE]\" }]. Each is a subset of { event, data, id }"
965
+ },
966
+ "cookies": {
967
+ "type": "object",
968
+ "description": "Cookies the response sets, by name: attributes as a subset ({ httpOnly: true, sameSite: Lax, value: ... }), or null for one it must not set",
969
+ "additionalProperties": {
970
+ "type": [
971
+ "object",
972
+ "null"
973
+ ]
974
+ }
975
+ },
976
+ "duration": {
977
+ "description": "The response arrived within this many milliseconds, or a matcher on the time: { $lt: 200 }",
978
+ "type": [
979
+ "integer",
980
+ "object"
981
+ ],
982
+ "minimum": 1
983
+ },
914
984
  "schema": {
915
985
  "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",
916
986
  "oneOf": [
@@ -1493,6 +1563,10 @@
1493
1563
  "properties": {
1494
1564
  "$regex": {
1495
1565
  "type": "string"
1566
+ },
1567
+ "$options": {
1568
+ "type": "string",
1569
+ "description": "Flags for $regex, e.g. i"
1496
1570
  }
1497
1571
  }
1498
1572
  }
@@ -1512,6 +1586,10 @@
1512
1586
  "properties": {
1513
1587
  "$regex": {
1514
1588
  "type": "string"
1589
+ },
1590
+ "$options": {
1591
+ "type": "string",
1592
+ "description": "Flags for $regex, e.g. i"
1515
1593
  }
1516
1594
  }
1517
1595
  }
@@ -1531,6 +1609,10 @@
1531
1609
  "properties": {
1532
1610
  "$regex": {
1533
1611
  "type": "string"
1612
+ },
1613
+ "$options": {
1614
+ "type": "string",
1615
+ "description": "Flags for $regex, e.g. i"
1534
1616
  }
1535
1617
  }
1536
1618
  }
@@ -1550,6 +1632,10 @@
1550
1632
  "properties": {
1551
1633
  "$regex": {
1552
1634
  "type": "string"
1635
+ },
1636
+ "$options": {
1637
+ "type": "string",
1638
+ "description": "Flags for $regex, e.g. i"
1553
1639
  }
1554
1640
  }
1555
1641
  }
@@ -1569,6 +1655,10 @@
1569
1655
  "properties": {
1570
1656
  "$regex": {
1571
1657
  "type": "string"
1658
+ },
1659
+ "$options": {
1660
+ "type": "string",
1661
+ "description": "Flags for $regex, e.g. i"
1572
1662
  }
1573
1663
  }
1574
1664
  }