@serenity-js/core 2.32.7 → 3.0.0-rc.10

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 (207) hide show
  1. package/CHANGELOG.md +350 -0
  2. package/lib/index.d.ts +2 -1
  3. package/lib/index.js +6 -1
  4. package/lib/index.js.map +1 -1
  5. package/lib/io/ErrorSerialiser.js +4 -1
  6. package/lib/io/ErrorSerialiser.js.map +1 -1
  7. package/lib/io/asyncMap.d.ts +8 -0
  8. package/lib/io/asyncMap.js +18 -0
  9. package/lib/io/asyncMap.js.map +1 -0
  10. package/lib/io/format.d.ts +39 -0
  11. package/lib/io/format.js +51 -0
  12. package/lib/io/format.js.map +1 -0
  13. package/lib/io/formatted.d.ts +5 -1
  14. package/lib/io/formatted.js +6 -13
  15. package/lib/io/formatted.js.map +1 -1
  16. package/lib/io/index.d.ts +2 -1
  17. package/lib/io/index.js +2 -1
  18. package/lib/io/index.js.map +1 -1
  19. package/lib/io/inspected.d.ts +9 -1
  20. package/lib/io/inspected.js +52 -15
  21. package/lib/io/inspected.js.map +1 -1
  22. package/lib/model/Timestamp.d.ts +4 -2
  23. package/lib/model/Timestamp.js +8 -2
  24. package/lib/model/Timestamp.js.map +1 -1
  25. package/lib/screenplay/Optional.d.ts +29 -0
  26. package/lib/{io/collections/reducible.js → screenplay/Optional.js} +1 -1
  27. package/lib/screenplay/Optional.js.map +1 -0
  28. package/lib/screenplay/Question.d.ts +41 -82
  29. package/lib/screenplay/Question.js +132 -100
  30. package/lib/screenplay/Question.js.map +1 -1
  31. package/lib/screenplay/actor/Actor.js +2 -2
  32. package/lib/screenplay/actor/Actor.js.map +1 -1
  33. package/lib/screenplay/index.d.ts +1 -1
  34. package/lib/screenplay/index.js +1 -1
  35. package/lib/screenplay/index.js.map +1 -1
  36. package/lib/screenplay/interactions/index.d.ts +0 -1
  37. package/lib/screenplay/interactions/index.js +0 -1
  38. package/lib/screenplay/interactions/index.js.map +1 -1
  39. package/lib/screenplay/questions/Check.d.ts +3 -3
  40. package/lib/screenplay/questions/Check.js +5 -7
  41. package/lib/screenplay/questions/Check.js.map +1 -1
  42. package/lib/screenplay/questions/Expectation.d.ts +15 -10
  43. package/lib/screenplay/questions/Expectation.js +28 -37
  44. package/lib/screenplay/questions/Expectation.js.map +1 -1
  45. package/lib/screenplay/questions/List.d.ts +22 -192
  46. package/lib/screenplay/questions/List.js +160 -208
  47. package/lib/screenplay/questions/List.js.map +1 -1
  48. package/lib/screenplay/questions/Note.d.ts +10 -0
  49. package/lib/screenplay/questions/Note.js +17 -1
  50. package/lib/screenplay/questions/Note.js.map +1 -1
  51. package/lib/screenplay/questions/index.d.ts +0 -3
  52. package/lib/screenplay/questions/index.js +0 -5
  53. package/lib/screenplay/questions/index.js.map +1 -1
  54. package/lib/stage/index.d.ts +0 -2
  55. package/lib/stage/index.js +0 -2
  56. package/lib/stage/index.js.map +1 -1
  57. package/package.json +7 -7
  58. package/src/index.ts +2 -1
  59. package/src/io/ErrorSerialiser.ts +5 -1
  60. package/src/io/asyncMap.ts +18 -0
  61. package/src/io/format.ts +49 -0
  62. package/src/io/formatted.ts +7 -15
  63. package/src/io/index.ts +2 -1
  64. package/src/io/inspected.ts +68 -15
  65. package/src/model/Timestamp.ts +10 -2
  66. package/src/screenplay/Optional.ts +30 -0
  67. package/src/screenplay/Question.ts +206 -124
  68. package/src/screenplay/actor/Actor.ts +2 -2
  69. package/src/screenplay/index.ts +1 -1
  70. package/src/screenplay/interactions/index.ts +0 -1
  71. package/src/screenplay/questions/Check.ts +10 -15
  72. package/src/screenplay/questions/Expectation.ts +48 -55
  73. package/src/screenplay/questions/List.ts +224 -233
  74. package/src/screenplay/questions/Note.ts +21 -1
  75. package/src/screenplay/questions/index.ts +0 -3
  76. package/src/stage/index.ts +0 -2
  77. package/lib/io/collections/index.d.ts +0 -2
  78. package/lib/io/collections/index.js +0 -15
  79. package/lib/io/collections/index.js.map +0 -1
  80. package/lib/io/collections/mappable.d.ts +0 -52
  81. package/lib/io/collections/mappable.js +0 -28
  82. package/lib/io/collections/mappable.js.map +0 -1
  83. package/lib/io/collections/reducible.d.ts +0 -16
  84. package/lib/io/collections/reducible.js.map +0 -1
  85. package/lib/screenplay/interactions/See.d.ts +0 -31
  86. package/lib/screenplay/interactions/See.js +0 -43
  87. package/lib/screenplay/interactions/See.js.map +0 -1
  88. package/lib/screenplay/questions/Property.d.ts +0 -91
  89. package/lib/screenplay/questions/Property.js +0 -99
  90. package/lib/screenplay/questions/Property.js.map +0 -1
  91. package/lib/screenplay/questions/Transform.d.ts +0 -31
  92. package/lib/screenplay/questions/Transform.js +0 -46
  93. package/lib/screenplay/questions/Transform.js.map +0 -1
  94. package/lib/screenplay/questions/lists/ArrayListAdapter.d.ts +0 -88
  95. package/lib/screenplay/questions/lists/ArrayListAdapter.js +0 -152
  96. package/lib/screenplay/questions/lists/ArrayListAdapter.js.map +0 -1
  97. package/lib/screenplay/questions/lists/ListAdapter.d.ts +0 -20
  98. package/lib/screenplay/questions/lists/ListAdapter.js +0 -3
  99. package/lib/screenplay/questions/lists/ListAdapter.js.map +0 -1
  100. package/lib/screenplay/questions/lists/index.d.ts +0 -2
  101. package/lib/screenplay/questions/lists/index.js +0 -15
  102. package/lib/screenplay/questions/lists/index.js.map +0 -1
  103. package/lib/screenplay/questions/mappings/AnswerMappingFunction.d.ts +0 -11
  104. package/lib/screenplay/questions/mappings/AnswerMappingFunction.js +0 -3
  105. package/lib/screenplay/questions/mappings/AnswerMappingFunction.js.map +0 -1
  106. package/lib/screenplay/questions/mappings/index.d.ts +0 -2
  107. package/lib/screenplay/questions/mappings/index.js +0 -15
  108. package/lib/screenplay/questions/mappings/index.js.map +0 -1
  109. package/lib/screenplay/questions/mappings/string/append.d.ts +0 -14
  110. package/lib/screenplay/questions/mappings/string/append.js +0 -25
  111. package/lib/screenplay/questions/mappings/string/append.js.map +0 -1
  112. package/lib/screenplay/questions/mappings/string/index.d.ts +0 -11
  113. package/lib/screenplay/questions/mappings/string/index.js +0 -24
  114. package/lib/screenplay/questions/mappings/string/index.js.map +0 -1
  115. package/lib/screenplay/questions/mappings/string/normalize.d.ts +0 -20
  116. package/lib/screenplay/questions/mappings/string/normalize.js +0 -30
  117. package/lib/screenplay/questions/mappings/string/normalize.js.map +0 -1
  118. package/lib/screenplay/questions/mappings/string/replace.d.ts +0 -17
  119. package/lib/screenplay/questions/mappings/string/replace.js +0 -30
  120. package/lib/screenplay/questions/mappings/string/replace.js.map +0 -1
  121. package/lib/screenplay/questions/mappings/string/slice.d.ts +0 -28
  122. package/lib/screenplay/questions/mappings/string/slice.js +0 -47
  123. package/lib/screenplay/questions/mappings/string/slice.js.map +0 -1
  124. package/lib/screenplay/questions/mappings/string/split.d.ts +0 -19
  125. package/lib/screenplay/questions/mappings/string/split.js +0 -36
  126. package/lib/screenplay/questions/mappings/string/split.js.map +0 -1
  127. package/lib/screenplay/questions/mappings/string/toLocaleLowerCase.d.ts +0 -17
  128. package/lib/screenplay/questions/mappings/string/toLocaleLowerCase.js +0 -28
  129. package/lib/screenplay/questions/mappings/string/toLocaleLowerCase.js.map +0 -1
  130. package/lib/screenplay/questions/mappings/string/toLocaleUpperCase.d.ts +0 -17
  131. package/lib/screenplay/questions/mappings/string/toLocaleUpperCase.js +0 -29
  132. package/lib/screenplay/questions/mappings/string/toLocaleUpperCase.js.map +0 -1
  133. package/lib/screenplay/questions/mappings/string/toLowerCase.d.ts +0 -10
  134. package/lib/screenplay/questions/mappings/string/toLowerCase.js +0 -19
  135. package/lib/screenplay/questions/mappings/string/toLowerCase.js.map +0 -1
  136. package/lib/screenplay/questions/mappings/string/toNumber.d.ts +0 -10
  137. package/lib/screenplay/questions/mappings/string/toNumber.js +0 -18
  138. package/lib/screenplay/questions/mappings/string/toNumber.js.map +0 -1
  139. package/lib/screenplay/questions/mappings/string/toUpperCase.d.ts +0 -10
  140. package/lib/screenplay/questions/mappings/string/toUpperCase.js +0 -19
  141. package/lib/screenplay/questions/mappings/string/toUpperCase.js.map +0 -1
  142. package/lib/screenplay/questions/mappings/string/trim.d.ts +0 -12
  143. package/lib/screenplay/questions/mappings/string/trim.js +0 -21
  144. package/lib/screenplay/questions/mappings/string/trim.js.map +0 -1
  145. package/lib/screenplay/questions/proxies/PropertyPathKey.d.ts +0 -4
  146. package/lib/screenplay/questions/proxies/PropertyPathKey.js +0 -3
  147. package/lib/screenplay/questions/proxies/PropertyPathKey.js.map +0 -1
  148. package/lib/screenplay/questions/proxies/createMetaQuestionProxy.d.ts +0 -14
  149. package/lib/screenplay/questions/proxies/createMetaQuestionProxy.js +0 -35
  150. package/lib/screenplay/questions/proxies/createMetaQuestionProxy.js.map +0 -1
  151. package/lib/screenplay/questions/proxies/createQuestionProxy.d.ts +0 -13
  152. package/lib/screenplay/questions/proxies/createQuestionProxy.js +0 -34
  153. package/lib/screenplay/questions/proxies/createQuestionProxy.js.map +0 -1
  154. package/lib/screenplay/questions/proxies/describePath.d.ts +0 -5
  155. package/lib/screenplay/questions/proxies/describePath.js +0 -19
  156. package/lib/screenplay/questions/proxies/describePath.js.map +0 -1
  157. package/lib/screenplay/questions/proxies/index.d.ts +0 -2
  158. package/lib/screenplay/questions/proxies/index.js +0 -15
  159. package/lib/screenplay/questions/proxies/index.js.map +0 -1
  160. package/lib/screenplay/questions/proxies/key.d.ts +0 -8
  161. package/lib/screenplay/questions/proxies/key.js +0 -16
  162. package/lib/screenplay/questions/proxies/key.js.map +0 -1
  163. package/lib/screenplay/tasks/Loop.d.ts +0 -198
  164. package/lib/screenplay/tasks/Loop.js +0 -222
  165. package/lib/screenplay/tasks/Loop.js.map +0 -1
  166. package/lib/screenplay/tasks/index.d.ts +0 -1
  167. package/lib/screenplay/tasks/index.js +0 -14
  168. package/lib/screenplay/tasks/index.js.map +0 -1
  169. package/lib/stage/DressingRoom.d.ts +0 -37
  170. package/lib/stage/DressingRoom.js +0 -53
  171. package/lib/stage/DressingRoom.js.map +0 -1
  172. package/lib/stage/WithStage.d.ts +0 -51
  173. package/lib/stage/WithStage.js +0 -3
  174. package/lib/stage/WithStage.js.map +0 -1
  175. package/src/io/collections/index.ts +0 -2
  176. package/src/io/collections/mappable.ts +0 -60
  177. package/src/io/collections/reducible.ts +0 -16
  178. package/src/screenplay/interactions/See.ts +0 -45
  179. package/src/screenplay/questions/Property.ts +0 -98
  180. package/src/screenplay/questions/Transform.ts +0 -51
  181. package/src/screenplay/questions/lists/ArrayListAdapter.ts +0 -186
  182. package/src/screenplay/questions/lists/ListAdapter.ts +0 -33
  183. package/src/screenplay/questions/lists/index.ts +0 -2
  184. package/src/screenplay/questions/mappings/AnswerMappingFunction.ts +0 -13
  185. package/src/screenplay/questions/mappings/index.ts +0 -2
  186. package/src/screenplay/questions/mappings/string/append.ts +0 -28
  187. package/src/screenplay/questions/mappings/string/index.ts +0 -11
  188. package/src/screenplay/questions/mappings/string/normalize.ts +0 -33
  189. package/src/screenplay/questions/mappings/string/replace.ts +0 -34
  190. package/src/screenplay/questions/mappings/string/slice.ts +0 -53
  191. package/src/screenplay/questions/mappings/string/split.ts +0 -38
  192. package/src/screenplay/questions/mappings/string/toLocaleLowerCase.ts +0 -31
  193. package/src/screenplay/questions/mappings/string/toLocaleUpperCase.ts +0 -30
  194. package/src/screenplay/questions/mappings/string/toLowerCase.ts +0 -20
  195. package/src/screenplay/questions/mappings/string/toNumber.ts +0 -19
  196. package/src/screenplay/questions/mappings/string/toUpperCase.ts +0 -20
  197. package/src/screenplay/questions/mappings/string/trim.ts +0 -22
  198. package/src/screenplay/questions/proxies/PropertyPathKey.ts +0 -4
  199. package/src/screenplay/questions/proxies/createMetaQuestionProxy.ts +0 -51
  200. package/src/screenplay/questions/proxies/createQuestionProxy.ts +0 -49
  201. package/src/screenplay/questions/proxies/describePath.ts +0 -23
  202. package/src/screenplay/questions/proxies/index.ts +0 -2
  203. package/src/screenplay/questions/proxies/key.ts +0 -14
  204. package/src/screenplay/tasks/Loop.ts +0 -240
  205. package/src/screenplay/tasks/index.ts +0 -1
  206. package/src/stage/DressingRoom.ts +0 -53
  207. package/src/stage/WithStage.ts +0 -52
package/CHANGELOG.md CHANGED
@@ -3,6 +3,356 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.0.0-rc.10](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v3.0.0-rc.10) (2022-02-03)
7
+
8
+
9
+
10
+ # [3.0.0-rc.9](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.8...v3.0.0-rc.9) (2022-02-01)
11
+
12
+
13
+ ### Features
14
+
15
+ * **web:** isVisible() works with Web elements in Shadow DOM ([cf84fb0](https://github.com/serenity-js/serenity-js/commit/cf84fb072a6b813338b68bb1dec3932ea8709e3e)), closes [#1085](https://github.com/serenity-js/serenity-js/issues/1085)
16
+
17
+
18
+
19
+ # [3.0.0-rc.8](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.7...v3.0.0-rc.8) (2022-01-28)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **core:** ensure Question.about doesn't expose internal interfaces ([4bfb6bc](https://github.com/serenity-js/serenity-js/commit/4bfb6bca6af81d23ced551f63df5bc9f35d581df)), closes [#1106](https://github.com/serenity-js/serenity-js/issues/1106)
25
+
26
+
27
+
28
+ # [3.0.0-rc.7](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.6...v3.0.0-rc.7) (2022-01-28)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **core:** removed deprecated interface DressingRoom; please use Cast instead ([d68b44b](https://github.com/serenity-js/serenity-js/commit/d68b44b545f50f6533523ab07008f9f89ac34433))
34
+ * **core:** removed deprecated interface WithStage ([45d1c2b](https://github.com/serenity-js/serenity-js/commit/45d1c2b3e0ff1946ccff97d148d0776f2fa60065))
35
+ * **core:** removed deprecated task to See.if ([dd5e2f5](https://github.com/serenity-js/serenity-js/commit/dd5e2f5c7e61444d40899f70d413f38bc9f6691a))
36
+
37
+
38
+ ### Features
39
+
40
+ * **assertions:** isPresent works with any Optional ([cea75dc](https://github.com/serenity-js/serenity-js/commit/cea75dc1c728e45e06a87aaf9c1573a237334285)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
41
+ * **core:** `f` and `d` question description formatters ([c9f3fad](https://github.com/serenity-js/serenity-js/commit/c9f3fadd86ec0196f2cdbf76d9628bbef0a3fcba))
42
+ * **core:** replaced `Adapter` with `QuestionAdapter` and introduced `Optional` ([8d84ad3](https://github.com/serenity-js/serenity-js/commit/8d84ad3863e3c726533d0f21934fb1e2fa8b3022)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
43
+ * **core:** support for Optional chaining, expectation isPresent, refactored Expectations ([1841ee5](https://github.com/serenity-js/serenity-js/commit/1841ee5fc48cfa403ddc53358f75764d9a010c21)), closes [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
44
+
45
+
46
+
47
+ # [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
48
+
49
+
50
+
51
+ # [3.0.0-rc.5](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2022-01-07)
52
+
53
+
54
+ ### Bug Fixes
55
+
56
+ * **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
57
+
58
+
59
+
60
+ # [3.0.0-rc.4](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-12-30)
61
+
62
+
63
+ ### Bug Fixes
64
+
65
+ * **core:** you can now retrieve the .length property of an Array wrapped in an Adapter<Array> ([c36e210](https://github.com/serenity-js/serenity-js/commit/c36e210c024052b96ba47e9663c7098e269c5688))
66
+
67
+
68
+
69
+ # [3.0.0-rc.3](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-12-29)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * **core:** refactored Mappable so that it's easier to implement filters ([176e0cd](https://github.com/serenity-js/serenity-js/commit/176e0cd0303d63271477b2b7a8e7b0572dda99a0)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
75
+ * **core:** removed interface Reducible since it's not used any more ([1e9f23b](https://github.com/serenity-js/serenity-js/commit/1e9f23b227e3c4509dd52d6885cde5d3ecd1d102))
76
+ * **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
77
+ * **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
78
+
79
+
80
+ ### Features
81
+
82
+ * **core:** forEach for List and PageElements ([4592fb7](https://github.com/serenity-js/serenity-js/commit/4592fb7e700bad17fd44d91bd9db169839802d01)), closes [#823](https://github.com/serenity-js/serenity-js/issues/823)
83
+ * **core:** List supports custom collectors ([cd3f2bc](https://github.com/serenity-js/serenity-js/commit/cd3f2bc1b536c8e56714aecd669bfed7ab078e0a))
84
+ * **core:** new implementation of List.where filters ([45b3c80](https://github.com/serenity-js/serenity-js/commit/45b3c8080ca467ac6362e5217e7899ca36a04cdc)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
85
+ * **core:** support for Screenplay-style collection filters and mapping (List.where & .eachMappedTo) ([3d3c02e](https://github.com/serenity-js/serenity-js/commit/3d3c02ebe0ec5c6865f91f1991fd59ef0190a16c)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
86
+ * **web:** re-introduced PageElements.where DSL and universal By selectors ([39fe0a1](https://github.com/serenity-js/serenity-js/commit/39fe0a10edf7f652e93911159e4a4689c36d6876)), closes [#1081](https://github.com/serenity-js/serenity-js/issues/1081)
87
+
88
+
89
+
90
+ # [3.0.0-rc.1](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2021-12-09)
91
+
92
+
93
+
94
+ # [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
95
+
96
+
97
+ ### Bug Fixes
98
+
99
+ * **core:** `formatted` can be configured to produce single- or multi-line descriptions ([21145a3](https://github.com/serenity-js/serenity-js/commit/21145a3dda17e87ea7bd950da4526b90f37a1edc))
100
+ * **core:** `inspected` produces a better description of functions used as parameters ([15535c6](https://github.com/serenity-js/serenity-js/commit/15535c675469651b835c0b358649a590f2c15b5d))
101
+ * **core:** 3.0 RC ([469d54e](https://github.com/serenity-js/serenity-js/commit/469d54e4f81ef430566b93852e3174826f8ef672)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
102
+ * **core:** answerProxy renamed to ProxyAnswer to better reflect its purpose ([a98fe41](https://github.com/serenity-js/serenity-js/commit/a98fe41378bc8475f027946e0f01a30f4789d57a))
103
+ * **core:** corrected type defs of Question.as ([681ce22](https://github.com/serenity-js/serenity-js/commit/681ce22259bf75161df7ce2454f4b6d73ea87259))
104
+ * **core:** exported createProxyAnswer to make it easier to use ([5471989](https://github.com/serenity-js/serenity-js/commit/547198985025d0ede2ab47ea89d8944960fb980d))
105
+ * **core:** removed Loop as it will be replaced ([0b63d27](https://github.com/serenity-js/serenity-js/commit/0b63d27745c905001adf3c219dd0e3cf44756320))
106
+ * **core:** removed Property as it will be replaced by new Question ([fd7fa10](https://github.com/serenity-js/serenity-js/commit/fd7fa10dfbaa0c0cba059c5f18920609c4bac014))
107
+ * **core:** removed Transform and mapping functions as they'll be replaced with new Question ([506eaea](https://github.com/serenity-js/serenity-js/commit/506eaeaf2df22cfde5d7ca6a8f413fc053556c2b))
108
+ * **core:** renamed "Model" type to "Adapter" to better reflect its purpose ([b4ea7a1](https://github.com/serenity-js/serenity-js/commit/b4ea7a100fac2c896990bf15cbc906de641196b8)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
109
+ * **cucumber:** support for recognising non-Serenity AssertionErrors in older version of Cucumber ([31e9e99](https://github.com/serenity-js/serenity-js/commit/31e9e9919c2fd1e87b3f4405d9b2a6ae0164e893))
110
+ * **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
111
+
112
+
113
+ ### Features
114
+
115
+ * **core:** question.about creates a proxy around the answer to simplify the API ([25e0841](https://github.com/serenity-js/serenity-js/commit/25e084116ad28a02b55fbd8814b6ffa0375ec433))
116
+ * **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
117
+ * **web:** Page.url() and Page.title() replace Website.url() and Website.title() ([49fe009](https://github.com/serenity-js/serenity-js/commit/49fe0094422ab53ec67d4ba303f80c33e382eebd)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
118
+ * **web:** removed Target in favour of PageElement ([69496c4](https://github.com/serenity-js/serenity-js/commit/69496c47c4a1ec7b92e7ab6c83da1559e926f28e)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
119
+ * **web:** support for working with cookies ([39cde6d](https://github.com/serenity-js/serenity-js/commit/39cde6de7a36d27a8b1c596493efbec94900af6b)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
120
+
121
+
122
+ ### BREAKING CHANGES
123
+
124
+ * **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
125
+ modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
126
+
127
+
128
+
129
+
130
+
131
+ # [3.0.0-rc.9](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.8...v3.0.0-rc.9) (2022-02-01)
132
+
133
+
134
+ ### Features
135
+
136
+ * **web:** isVisible() works with Web elements in Shadow DOM ([cf84fb0](https://github.com/serenity-js/serenity-js/commit/cf84fb072a6b813338b68bb1dec3932ea8709e3e)), closes [#1085](https://github.com/serenity-js/serenity-js/issues/1085)
137
+
138
+
139
+
140
+
141
+
142
+ # [3.0.0-rc.8](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.7...v3.0.0-rc.8) (2022-01-28)
143
+
144
+
145
+ ### Bug Fixes
146
+
147
+ * **core:** ensure Question.about doesn't expose internal interfaces ([4bfb6bc](https://github.com/serenity-js/serenity-js/commit/4bfb6bca6af81d23ced551f63df5bc9f35d581df)), closes [#1106](https://github.com/serenity-js/serenity-js/issues/1106)
148
+
149
+
150
+
151
+
152
+
153
+ # [3.0.0-rc.7](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.6...v3.0.0-rc.7) (2022-01-28)
154
+
155
+
156
+ ### Bug Fixes
157
+
158
+ * **core:** removed deprecated interface DressingRoom; please use Cast instead ([d68b44b](https://github.com/serenity-js/serenity-js/commit/d68b44b545f50f6533523ab07008f9f89ac34433))
159
+ * **core:** removed deprecated interface WithStage ([45d1c2b](https://github.com/serenity-js/serenity-js/commit/45d1c2b3e0ff1946ccff97d148d0776f2fa60065))
160
+ * **core:** removed deprecated task to See.if ([dd5e2f5](https://github.com/serenity-js/serenity-js/commit/dd5e2f5c7e61444d40899f70d413f38bc9f6691a))
161
+
162
+
163
+ ### Features
164
+
165
+ * **assertions:** isPresent works with any Optional ([cea75dc](https://github.com/serenity-js/serenity-js/commit/cea75dc1c728e45e06a87aaf9c1573a237334285)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
166
+ * **core:** `f` and `d` question description formatters ([c9f3fad](https://github.com/serenity-js/serenity-js/commit/c9f3fadd86ec0196f2cdbf76d9628bbef0a3fcba))
167
+ * **core:** replaced `Adapter` with `QuestionAdapter` and introduced `Optional` ([8d84ad3](https://github.com/serenity-js/serenity-js/commit/8d84ad3863e3c726533d0f21934fb1e2fa8b3022)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
168
+ * **core:** support for Optional chaining, expectation isPresent, refactored Expectations ([1841ee5](https://github.com/serenity-js/serenity-js/commit/1841ee5fc48cfa403ddc53358f75764d9a010c21)), closes [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
169
+
170
+
171
+
172
+
173
+
174
+ # [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
175
+
176
+
177
+
178
+ # [3.0.0-rc.5](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2022-01-07)
179
+
180
+
181
+ ### Bug Fixes
182
+
183
+ * **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
184
+
185
+
186
+
187
+ # [3.0.0-rc.4](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-12-30)
188
+
189
+
190
+ ### Bug Fixes
191
+
192
+ * **core:** you can now retrieve the .length property of an Array wrapped in an Adapter<Array> ([c36e210](https://github.com/serenity-js/serenity-js/commit/c36e210c024052b96ba47e9663c7098e269c5688))
193
+
194
+
195
+
196
+ # [3.0.0-rc.3](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-12-29)
197
+
198
+
199
+ ### Bug Fixes
200
+
201
+ * **core:** refactored Mappable so that it's easier to implement filters ([176e0cd](https://github.com/serenity-js/serenity-js/commit/176e0cd0303d63271477b2b7a8e7b0572dda99a0)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
202
+ * **core:** removed interface Reducible since it's not used any more ([1e9f23b](https://github.com/serenity-js/serenity-js/commit/1e9f23b227e3c4509dd52d6885cde5d3ecd1d102))
203
+ * **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
204
+ * **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
205
+
206
+
207
+ ### Features
208
+
209
+ * **core:** forEach for List and PageElements ([4592fb7](https://github.com/serenity-js/serenity-js/commit/4592fb7e700bad17fd44d91bd9db169839802d01)), closes [#823](https://github.com/serenity-js/serenity-js/issues/823)
210
+ * **core:** List supports custom collectors ([cd3f2bc](https://github.com/serenity-js/serenity-js/commit/cd3f2bc1b536c8e56714aecd669bfed7ab078e0a))
211
+ * **core:** new implementation of List.where filters ([45b3c80](https://github.com/serenity-js/serenity-js/commit/45b3c8080ca467ac6362e5217e7899ca36a04cdc)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
212
+ * **core:** support for Screenplay-style collection filters and mapping (List.where & .eachMappedTo) ([3d3c02e](https://github.com/serenity-js/serenity-js/commit/3d3c02ebe0ec5c6865f91f1991fd59ef0190a16c)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
213
+ * **web:** re-introduced PageElements.where DSL and universal By selectors ([39fe0a1](https://github.com/serenity-js/serenity-js/commit/39fe0a10edf7f652e93911159e4a4689c36d6876)), closes [#1081](https://github.com/serenity-js/serenity-js/issues/1081)
214
+
215
+
216
+
217
+ # [3.0.0-rc.1](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2021-12-09)
218
+
219
+
220
+
221
+ # [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
222
+
223
+
224
+ ### Bug Fixes
225
+
226
+ * **core:** `formatted` can be configured to produce single- or multi-line descriptions ([21145a3](https://github.com/serenity-js/serenity-js/commit/21145a3dda17e87ea7bd950da4526b90f37a1edc))
227
+ * **core:** `inspected` produces a better description of functions used as parameters ([15535c6](https://github.com/serenity-js/serenity-js/commit/15535c675469651b835c0b358649a590f2c15b5d))
228
+ * **core:** 3.0 RC ([469d54e](https://github.com/serenity-js/serenity-js/commit/469d54e4f81ef430566b93852e3174826f8ef672)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
229
+ * **core:** answerProxy renamed to ProxyAnswer to better reflect its purpose ([a98fe41](https://github.com/serenity-js/serenity-js/commit/a98fe41378bc8475f027946e0f01a30f4789d57a))
230
+ * **core:** corrected type defs of Question.as ([681ce22](https://github.com/serenity-js/serenity-js/commit/681ce22259bf75161df7ce2454f4b6d73ea87259))
231
+ * **core:** exported createProxyAnswer to make it easier to use ([5471989](https://github.com/serenity-js/serenity-js/commit/547198985025d0ede2ab47ea89d8944960fb980d))
232
+ * **core:** removed Loop as it will be replaced ([0b63d27](https://github.com/serenity-js/serenity-js/commit/0b63d27745c905001adf3c219dd0e3cf44756320))
233
+ * **core:** removed Property as it will be replaced by new Question ([fd7fa10](https://github.com/serenity-js/serenity-js/commit/fd7fa10dfbaa0c0cba059c5f18920609c4bac014))
234
+ * **core:** removed Transform and mapping functions as they'll be replaced with new Question ([506eaea](https://github.com/serenity-js/serenity-js/commit/506eaeaf2df22cfde5d7ca6a8f413fc053556c2b))
235
+ * **core:** renamed "Model" type to "Adapter" to better reflect its purpose ([b4ea7a1](https://github.com/serenity-js/serenity-js/commit/b4ea7a100fac2c896990bf15cbc906de641196b8)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
236
+ * **cucumber:** support for recognising non-Serenity AssertionErrors in older version of Cucumber ([31e9e99](https://github.com/serenity-js/serenity-js/commit/31e9e9919c2fd1e87b3f4405d9b2a6ae0164e893))
237
+ * **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
238
+
239
+
240
+ ### Features
241
+
242
+ * **core:** question.about creates a proxy around the answer to simplify the API ([25e0841](https://github.com/serenity-js/serenity-js/commit/25e084116ad28a02b55fbd8814b6ffa0375ec433))
243
+ * **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
244
+ * **web:** Page.url() and Page.title() replace Website.url() and Website.title() ([49fe009](https://github.com/serenity-js/serenity-js/commit/49fe0094422ab53ec67d4ba303f80c33e382eebd)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
245
+ * **web:** removed Target in favour of PageElement ([69496c4](https://github.com/serenity-js/serenity-js/commit/69496c47c4a1ec7b92e7ab6c83da1559e926f28e)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
246
+ * **web:** support for working with cookies ([39cde6d](https://github.com/serenity-js/serenity-js/commit/39cde6de7a36d27a8b1c596493efbec94900af6b)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
247
+
248
+
249
+ ### BREAKING CHANGES
250
+
251
+ * **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
252
+ modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
253
+
254
+
255
+
256
+
257
+
258
+ # [3.0.0-rc.5](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2022-01-07)
259
+
260
+
261
+ ### Bug Fixes
262
+
263
+ * **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
264
+
265
+
266
+
267
+
268
+
269
+ # [3.0.0-rc.4](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-12-30)
270
+
271
+
272
+ ### Bug Fixes
273
+
274
+ * **core:** you can now retrieve the .length property of an Array wrapped in an Adapter<Array> ([c36e210](https://github.com/serenity-js/serenity-js/commit/c36e210c024052b96ba47e9663c7098e269c5688))
275
+
276
+
277
+
278
+
279
+
280
+ # [3.0.0-rc.3](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-12-29)
281
+
282
+
283
+ ### Bug Fixes
284
+
285
+ * **core:** refactored Mappable so that it's easier to implement filters ([176e0cd](https://github.com/serenity-js/serenity-js/commit/176e0cd0303d63271477b2b7a8e7b0572dda99a0)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
286
+ * **core:** removed interface Reducible since it's not used any more ([1e9f23b](https://github.com/serenity-js/serenity-js/commit/1e9f23b227e3c4509dd52d6885cde5d3ecd1d102))
287
+ * **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
288
+ * **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
289
+
290
+
291
+ ### Features
292
+
293
+ * **core:** forEach for List and PageElements ([4592fb7](https://github.com/serenity-js/serenity-js/commit/4592fb7e700bad17fd44d91bd9db169839802d01)), closes [#823](https://github.com/serenity-js/serenity-js/issues/823)
294
+ * **core:** List supports custom collectors ([cd3f2bc](https://github.com/serenity-js/serenity-js/commit/cd3f2bc1b536c8e56714aecd669bfed7ab078e0a))
295
+ * **core:** new implementation of List.where filters ([45b3c80](https://github.com/serenity-js/serenity-js/commit/45b3c8080ca467ac6362e5217e7899ca36a04cdc)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
296
+ * **core:** support for Screenplay-style collection filters and mapping (List.where & .eachMappedTo) ([3d3c02e](https://github.com/serenity-js/serenity-js/commit/3d3c02ebe0ec5c6865f91f1991fd59ef0190a16c)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
297
+ * **web:** re-introduced PageElements.where DSL and universal By selectors ([39fe0a1](https://github.com/serenity-js/serenity-js/commit/39fe0a10edf7f652e93911159e4a4689c36d6876)), closes [#1081](https://github.com/serenity-js/serenity-js/issues/1081)
298
+
299
+
300
+
301
+
302
+
303
+ # [3.0.0-rc.1](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2021-12-09)
304
+
305
+ **Note:** Version bump only for package @serenity-js/core
306
+
307
+
308
+
309
+
310
+
311
+ # [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
312
+
313
+
314
+ ### Bug Fixes
315
+
316
+ * **core:** `formatted` can be configured to produce single- or multi-line descriptions ([21145a3](https://github.com/serenity-js/serenity-js/commit/21145a3dda17e87ea7bd950da4526b90f37a1edc))
317
+ * **core:** `inspected` produces a better description of functions used as parameters ([15535c6](https://github.com/serenity-js/serenity-js/commit/15535c675469651b835c0b358649a590f2c15b5d))
318
+ * **core:** 3.0 RC ([469d54e](https://github.com/serenity-js/serenity-js/commit/469d54e4f81ef430566b93852e3174826f8ef672)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
319
+ * **core:** answerProxy renamed to ProxyAnswer to better reflect its purpose ([a98fe41](https://github.com/serenity-js/serenity-js/commit/a98fe41378bc8475f027946e0f01a30f4789d57a))
320
+ * **core:** corrected type defs of Question.as ([681ce22](https://github.com/serenity-js/serenity-js/commit/681ce22259bf75161df7ce2454f4b6d73ea87259))
321
+ * **core:** exported createProxyAnswer to make it easier to use ([5471989](https://github.com/serenity-js/serenity-js/commit/547198985025d0ede2ab47ea89d8944960fb980d))
322
+ * **core:** removed Loop as it will be replaced ([0b63d27](https://github.com/serenity-js/serenity-js/commit/0b63d27745c905001adf3c219dd0e3cf44756320))
323
+ * **core:** removed Property as it will be replaced by new Question ([fd7fa10](https://github.com/serenity-js/serenity-js/commit/fd7fa10dfbaa0c0cba059c5f18920609c4bac014))
324
+ * **core:** removed Transform and mapping functions as they'll be replaced with new Question ([506eaea](https://github.com/serenity-js/serenity-js/commit/506eaeaf2df22cfde5d7ca6a8f413fc053556c2b))
325
+ * **core:** renamed "Model" type to "Adapter" to better reflect its purpose ([b4ea7a1](https://github.com/serenity-js/serenity-js/commit/b4ea7a100fac2c896990bf15cbc906de641196b8)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
326
+ * **cucumber:** support for recognising non-Serenity AssertionErrors in older version of Cucumber ([31e9e99](https://github.com/serenity-js/serenity-js/commit/31e9e9919c2fd1e87b3f4405d9b2a6ae0164e893))
327
+ * **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
328
+
329
+
330
+ ### Features
331
+
332
+ * **core:** question.about creates a proxy around the answer to simplify the API ([25e0841](https://github.com/serenity-js/serenity-js/commit/25e084116ad28a02b55fbd8814b6ffa0375ec433))
333
+ * **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
334
+ * **web:** Page.url() and Page.title() replace Website.url() and Website.title() ([49fe009](https://github.com/serenity-js/serenity-js/commit/49fe0094422ab53ec67d4ba303f80c33e382eebd)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
335
+ * **web:** removed Target in favour of PageElement ([69496c4](https://github.com/serenity-js/serenity-js/commit/69496c47c4a1ec7b92e7ab6c83da1559e926f28e)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
336
+ * **web:** support for working with cookies ([39cde6d](https://github.com/serenity-js/serenity-js/commit/39cde6de7a36d27a8b1c596493efbec94900af6b)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
337
+
338
+
339
+ ### BREAKING CHANGES
340
+
341
+ * **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
342
+ modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
343
+
344
+
345
+
346
+
347
+
348
+ # [2.33.0](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v2.33.0) (2022-02-03)
349
+
350
+ **Note:** Version bump only for package @serenity-js/core
351
+
352
+
353
+
354
+
355
+
6
356
  ## [2.32.7](https://github.com/serenity-js/serenity-js/compare/v2.32.6...v2.32.7) (2022-01-10)
7
357
 
8
358
  **Note:** Version bump only for package @serenity-js/core
package/lib/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './errors';
2
2
  export * from './instance';
3
- export { Duration } from './model';
3
+ export { d, f, format } from './io';
4
+ export { Duration, Timestamp } from './model';
4
5
  export * from './screenplay';
5
6
  export * from './Serenity';
6
7
  export { SerenityConfig } from './SerenityConfig';
package/lib/index.js CHANGED
@@ -10,11 +10,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.SerenityConfig = exports.Duration = void 0;
13
+ exports.SerenityConfig = exports.Timestamp = exports.Duration = exports.format = exports.f = exports.d = void 0;
14
14
  __exportStar(require("./errors"), exports);
15
15
  __exportStar(require("./instance"), exports);
16
+ var io_1 = require("./io");
17
+ Object.defineProperty(exports, "d", { enumerable: true, get: function () { return io_1.d; } });
18
+ Object.defineProperty(exports, "f", { enumerable: true, get: function () { return io_1.f; } });
19
+ Object.defineProperty(exports, "format", { enumerable: true, get: function () { return io_1.format; } });
16
20
  var model_1 = require("./model");
17
21
  Object.defineProperty(exports, "Duration", { enumerable: true, get: function () { return model_1.Duration; } });
22
+ Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return model_1.Timestamp; } });
18
23
  __exportStar(require("./screenplay"), exports);
19
24
  __exportStar(require("./Serenity"), exports);
20
25
  var SerenityConfig_1 = require("./SerenityConfig");
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,iCAAmC;AAA1B,iGAAA,QAAQ,OAAA;AACjB,+CAA6B;AAC7B,6CAA2B;AAC3B,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,2BAAoC;AAA3B,uFAAA,CAAC,OAAA;AAAE,uFAAA,CAAC,OAAA;AAAE,4FAAA,MAAM,OAAA;AACrB,iCAA8C;AAArC,iGAAA,QAAQ,OAAA;AAAE,kGAAA,SAAS,OAAA;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,0CAAwB"}
@@ -5,10 +5,13 @@ const serenitySpecificErrors = require("../errors");
5
5
  const json_1 = require("./json");
6
6
  class ErrorSerialiser {
7
7
  static serialise(error) {
8
+ const name = error && error.constructor && error.constructor.name
9
+ ? error.constructor.name
10
+ : error.name;
8
11
  const serialisedError = Object.getOwnPropertyNames(error).reduce((serialised, key) => {
9
12
  serialised[key] = error[key];
10
13
  return serialised;
11
- }, { name: error.constructor.name || error.name });
14
+ }, { name });
12
15
  return (0, json_1.stringify)(serialisedError);
13
16
  }
14
17
  static deserialise(stringifiedError) {
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorSerialiser.js","sourceRoot":"","sources":["../../src/io/ErrorSerialiser.ts"],"names":[],"mappings":";;;AAEA,oDAAoD;AACpD,iCAA0C;AAyB1C,MAAa,eAAe;IAYxB,MAAM,CAAC,SAAS,CAAC,KAAY;QACzB,MAAM,eAAe,GAAG,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE;YACjF,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;YAC5B,OAAO,UAAU,CAAC;QACtB,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CAAoB,CAAC;QAEtE,OAAO,IAAA,gBAAS,EAAC,eAAe,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,WAAW,CAAkB,gBAAwB;QACxD,MAAM,eAAe,GAAG,IAAA,YAAK,EAAC,gBAAgB,CAAoB,CAAC;QAEnE,MAAM,WAAW,GAAG,eAAe,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,eAAe,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;QACzH,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC1D,KAAK,MAAM,QAAQ,IAAI,eAAe,EAAE;YACpC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE;gBACjE,YAAY,CAAC,QAAQ,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;aACtD;SACJ;QACD,OAAO,YAAY,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,yBAAyB,CAAC,KAAa;QAC1C,MAAM,iBAAiB,GAAG,+CAA+C,CAAC;QAE1E,IAAI,CAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACjC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;SACnC;QAED,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,CAAE,GAAG,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAEtE,OAAO,eAAe,CAAC,WAAW,CAAC,IAAA,gBAAS,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC5F,CAAC;;AA5CL,0CA6CC;AA5CkB,gCAAgB,GAAG;IAC9B,GAAG,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;IAC9E,KAAK;IACL,SAAS;IACT,UAAU;IACV,cAAc;IACd,WAAW;IACX,SAAS;IACT,QAAQ;CACX,CAAC"}
1
+ {"version":3,"file":"ErrorSerialiser.js","sourceRoot":"","sources":["../../src/io/ErrorSerialiser.ts"],"names":[],"mappings":";;;AAEA,oDAAoD;AACpD,iCAA0C;AAyB1C,MAAa,eAAe;IAYxB,MAAM,CAAC,SAAS,CAAC,KAAY;QACzB,MAAM,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI;YAC7D,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI;YACxB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QAEjB,MAAM,eAAe,GAAG,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE;YACjF,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;YAC5B,OAAO,UAAU,CAAC;QACtB,CAAC,EAAE,EAAE,IAAI,EAAE,CAAoB,CAAC;QAEhC,OAAO,IAAA,gBAAS,EAAC,eAAe,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,WAAW,CAAkB,gBAAwB;QACxD,MAAM,eAAe,GAAG,IAAA,YAAK,EAAC,gBAAgB,CAAoB,CAAC;QAEnE,MAAM,WAAW,GAAG,eAAe,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,eAAe,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;QACzH,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC1D,KAAK,MAAM,QAAQ,IAAI,eAAe,EAAE;YACpC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE;gBACjE,YAAY,CAAC,QAAQ,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;aACtD;SACJ;QACD,OAAO,YAAY,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,yBAAyB,CAAC,KAAa;QAC1C,MAAM,iBAAiB,GAAG,+CAA+C,CAAC;QAE1E,IAAI,CAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACjC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;SACnC;QAED,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,CAAE,GAAG,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAEtE,OAAO,eAAe,CAAC,WAAW,CAAC,IAAA,gBAAS,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC5F,CAAC;;AAhDL,0CAiDC;AAhDkB,gCAAgB,GAAG;IAC9B,GAAG,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;IAC9E,KAAK;IACL,SAAS;IACT,UAAU;IACV,cAAc;IACd,WAAW;IACX,SAAS;IACT,QAAQ;CACX,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @desc
3
+ * Maps an Array<Item_Type> to an Array<Result_Type>, one element at a time.
4
+ *
5
+ * @param {Array<Item_Type>} items
6
+ * @param {function(item: Item_Type): Promise<Result_Type>} mappingFunction
7
+ */
8
+ export declare function asyncMap<Item_Type, Result_Type>(items: Item_Type[], mappingFunction: (item: Item_Type) => Promise<Result_Type> | Result_Type): Promise<Result_Type[]>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asyncMap = void 0;
4
+ /**
5
+ * @desc
6
+ * Maps an Array<Item_Type> to an Array<Result_Type>, one element at a time.
7
+ *
8
+ * @param {Array<Item_Type>} items
9
+ * @param {function(item: Item_Type): Promise<Result_Type>} mappingFunction
10
+ */
11
+ function asyncMap(items, mappingFunction) {
12
+ return items.reduce((previous, item) => previous.then(async (acc) => {
13
+ const result = await mappingFunction(item);
14
+ return acc.concat(result);
15
+ }), Promise.resolve([]));
16
+ }
17
+ exports.asyncMap = asyncMap;
18
+ //# sourceMappingURL=asyncMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncMap.js","sourceRoot":"","sources":["../../src/io/asyncMap.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAyB,KAAkB,EAAE,eAAwE;IACzI,OAAO,KAAK,CAAC,MAAM,CACf,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CACf,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;QAE3C,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,EACJ,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CACxB,CAAC;AACN,CAAC;AAVD,4BAUC"}
@@ -0,0 +1,39 @@
1
+ import { Answerable } from '../screenplay';
2
+ /**
3
+ * @desc
4
+ * A factory function returning a tag function that produces a human-readable description of a template containing one or more {@link Answerable}s.
5
+ *
6
+ * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals
7
+ *
8
+ * @example
9
+ * import { format, Question } from '@serenity-js/core';
10
+ *
11
+ * const someQuestion = () =>
12
+ * Question.about('some question', actor => 'some value');
13
+ *
14
+ * format({ markQuestions: true }) `actor answers ${ question() }`;
15
+ * // returns: actor answers <<some question>>
16
+ *
17
+ * format({ markQuestions: false }) `actor answers ${ question() }`;
18
+ * // returns: actor answers <<some question>>
19
+ *
20
+ * @example <caption>Aliasing</caption>
21
+ * import { format, Question } from '@serenity-js/core';
22
+ *
23
+ * const f = format({ markQuestions: true });
24
+ *
25
+ * const someQuestion = () =>
26
+ * Question.about('some question', actor => 'some value');
27
+ *
28
+ * f `actor answers ${ question() }`;
29
+ * // produces: actor answers <<some question>>
30
+ *
31
+ * @param {object} config
32
+ * - `markQuestions`: boolean - if set to true, descriptions of questions passed in as arguments will be surrounded with double angled brackets, i.e. `<<description>>`
33
+ * @returns {function(templates: TemplateStringsArray, placeholders: ...Array<Answerable<any>>): string}
34
+ */
35
+ export declare function format(config: {
36
+ markQuestions: boolean;
37
+ }): (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>) => string;
38
+ export declare const f: (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>) => string;
39
+ export declare const d: (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>) => string;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.d = exports.f = exports.format = void 0;
4
+ const inspected_1 = require("./inspected");
5
+ /**
6
+ * @desc
7
+ * A factory function returning a tag function that produces a human-readable description of a template containing one or more {@link Answerable}s.
8
+ *
9
+ * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals
10
+ *
11
+ * @example
12
+ * import { format, Question } from '@serenity-js/core';
13
+ *
14
+ * const someQuestion = () =>
15
+ * Question.about('some question', actor => 'some value');
16
+ *
17
+ * format({ markQuestions: true }) `actor answers ${ question() }`;
18
+ * // returns: actor answers <<some question>>
19
+ *
20
+ * format({ markQuestions: false }) `actor answers ${ question() }`;
21
+ * // returns: actor answers <<some question>>
22
+ *
23
+ * @example <caption>Aliasing</caption>
24
+ * import { format, Question } from '@serenity-js/core';
25
+ *
26
+ * const f = format({ markQuestions: true });
27
+ *
28
+ * const someQuestion = () =>
29
+ * Question.about('some question', actor => 'some value');
30
+ *
31
+ * f `actor answers ${ question() }`;
32
+ * // produces: actor answers <<some question>>
33
+ *
34
+ * @param {object} config
35
+ * - `markQuestions`: boolean - if set to true, descriptions of questions passed in as arguments will be surrounded with double angled brackets, i.e. `<<description>>`
36
+ * @returns {function(templates: TemplateStringsArray, placeholders: ...Array<Answerable<any>>): string}
37
+ */
38
+ function format(config) {
39
+ return (templates, ...placeholders) => {
40
+ return templates
41
+ .map((template, i) => i < placeholders.length
42
+ ? [template, (0, inspected_1.inspected)(placeholders[i], { inline: true, markQuestions: config.markQuestions })]
43
+ : [template])
44
+ .reduce((acc, tuple) => acc.concat(tuple))
45
+ .join('');
46
+ };
47
+ }
48
+ exports.format = format;
49
+ exports.f = format({ markQuestions: true });
50
+ exports.d = format({ markQuestions: false });
51
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/io/format.ts"],"names":[],"mappings":";;;AACA,2CAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,SAAgB,MAAM,CAAC,MAAkC;IACrD,OAAO,CAAC,SAA+B,EAAE,GAAG,YAAoC,EAAU,EAAE;QACxF,OAAO,SAAS;aACX,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,MAAM;YACzC,CAAC,CAAC,CAAE,QAAQ,EAAE,IAAA,qBAAS,EAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAE;YACjG,CAAC,CAAC,CAAE,QAAQ,CAAE,CAAC;aAClB,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACzC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAA;AACL,CAAC;AATD,wBASC;AAEY,QAAA,CAAC,GAAG,MAAM,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AACpC,QAAA,CAAC,GAAG,MAAM,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC"}
@@ -1,10 +1,14 @@
1
- import { Answerable } from '../screenplay/Answerable';
1
+ import { Answerable } from '../screenplay';
2
2
  /**
3
3
  * @desc
4
4
  * A tag function returning a human-readable description of a template containing one or more {@link Answerable}s.
5
+ * This function is deprecated, please use {@link format} instead.
5
6
  *
6
7
  * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals
7
8
  *
9
+ *
10
+ * @deprecated
11
+ *
8
12
  * @param {TemplateStringsArray} templates
9
13
  * @param {Array<Answerable<any>>} placeholders
10
14
  * @returns {string}
@@ -1,30 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatted = void 0;
4
- const inspected_1 = require("./inspected");
4
+ const format_1 = require("./format");
5
5
  /**
6
6
  * @desc
7
7
  * A tag function returning a human-readable description of a template containing one or more {@link Answerable}s.
8
+ * This function is deprecated, please use {@link format} instead.
8
9
  *
9
10
  * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals
10
11
  *
12
+ *
13
+ * @deprecated
14
+ *
11
15
  * @param {TemplateStringsArray} templates
12
16
  * @param {Array<Answerable<any>>} placeholders
13
17
  * @returns {string}
14
18
  */
15
19
  function formatted(templates, ...placeholders) {
16
- return templates
17
- .map((template, i) => i < placeholders.length
18
- ? [template, compacted((0, inspected_1.inspected)(placeholders[i]))]
19
- : [template])
20
- .reduce((acc, tuple) => acc.concat(tuple))
21
- .join('');
20
+ return (0, format_1.format)({ markQuestions: false })(templates, ...placeholders);
22
21
  }
23
22
  exports.formatted = formatted;
24
- /** @private */
25
- function compacted(multiline) {
26
- return multiline
27
- .replace(/\r?\n/g, ' ')
28
- .replace(/\s+/g, ' ');
29
- }
30
23
  //# sourceMappingURL=formatted.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatted.js","sourceRoot":"","sources":["../../src/io/formatted.ts"],"names":[],"mappings":";;;AACA,2CAAwC;AAExC;;;;;;;;;GASG;AACH,SAAgB,SAAS,CAAC,SAA+B,EAAE,GAAG,YAAoC;IAC9F,OAAO,SAAS;SACX,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,MAAM;QACzC,CAAC,CAAC,CAAE,QAAQ,EAAE,SAAS,CAAC,IAAA,qBAAS,EAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE;QACrD,CAAC,CAAC,CAAE,QAAQ,CAAE,CAAC;SAClB,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SACzC,IAAI,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAPD,8BAOC;AAED,eAAe;AACf,SAAS,SAAS,CAAC,SAAiB;IAChC,OAAO,SAAS;SACX,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;SACtB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC9B,CAAC"}
1
+ {"version":3,"file":"formatted.js","sourceRoot":"","sources":["../../src/io/formatted.ts"],"names":[],"mappings":";;;AACA,qCAAkC;AAElC;;;;;;;;;;;;;GAaG;AACH,SAAgB,SAAS,CAAC,SAA+B,EAAE,GAAG,YAAoC;IAC9F,OAAO,IAAA,eAAM,EAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,GAAG,YAAY,CAAC,CAAC;AACxE,CAAC;AAFD,8BAEC"}
package/lib/io/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './AssertionReportDiffer';
2
- export * from './collections';
2
+ export * from './asyncMap';
3
3
  export * from './commaSeparated';
4
4
  export * from './Config';
5
5
  export * from './ErrorSerialiser';
@@ -7,6 +7,7 @@ export * from './ErrorStackParser';
7
7
  export * from './FileFinder';
8
8
  export * from './FileSystem';
9
9
  export * from './FileSystemLocation';
10
+ export * from './format';
10
11
  export * from './formatted';
11
12
  export * from './json';
12
13
  export * from './ModuleLoader';