@serenity-js/assertions 3.0.0-rc.40 → 3.0.0-rc.42

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 (94) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +4 -4
  3. package/lib/Ensure.d.ts +2 -14
  4. package/lib/Ensure.d.ts.map +1 -1
  5. package/lib/Ensure.js +25 -51
  6. package/lib/Ensure.js.map +1 -1
  7. package/lib/expectations/and.d.ts.map +1 -1
  8. package/lib/expectations/and.js +10 -5
  9. package/lib/expectations/and.js.map +1 -1
  10. package/lib/expectations/contain.d.ts +2 -2
  11. package/lib/expectations/contain.d.ts.map +1 -1
  12. package/lib/expectations/contain.js +1 -5
  13. package/lib/expectations/contain.js.map +1 -1
  14. package/lib/expectations/containAtLeastOneItemThat.d.ts.map +1 -1
  15. package/lib/expectations/containAtLeastOneItemThat.js +5 -4
  16. package/lib/expectations/containAtLeastOneItemThat.js.map +1 -1
  17. package/lib/expectations/containItemsWhereEachItem.d.ts.map +1 -1
  18. package/lib/expectations/containItemsWhereEachItem.js +5 -4
  19. package/lib/expectations/containItemsWhereEachItem.js.map +1 -1
  20. package/lib/expectations/endsWith.d.ts +2 -2
  21. package/lib/expectations/endsWith.d.ts.map +1 -1
  22. package/lib/expectations/endsWith.js +1 -5
  23. package/lib/expectations/endsWith.js.map +1 -1
  24. package/lib/expectations/equals.d.ts +2 -2
  25. package/lib/expectations/equals.d.ts.map +1 -1
  26. package/lib/expectations/equals.js +1 -5
  27. package/lib/expectations/equals.js.map +1 -1
  28. package/lib/expectations/includes.d.ts +2 -2
  29. package/lib/expectations/includes.d.ts.map +1 -1
  30. package/lib/expectations/includes.js +1 -5
  31. package/lib/expectations/includes.js.map +1 -1
  32. package/lib/expectations/isAfter.d.ts +2 -2
  33. package/lib/expectations/isAfter.d.ts.map +1 -1
  34. package/lib/expectations/isAfter.js +1 -5
  35. package/lib/expectations/isAfter.js.map +1 -1
  36. package/lib/expectations/isBefore.d.ts +2 -2
  37. package/lib/expectations/isBefore.d.ts.map +1 -1
  38. package/lib/expectations/isBefore.js +1 -5
  39. package/lib/expectations/isBefore.js.map +1 -1
  40. package/lib/expectations/isCloseTo.d.ts +2 -2
  41. package/lib/expectations/isCloseTo.d.ts.map +1 -1
  42. package/lib/expectations/isCloseTo.js +10 -30
  43. package/lib/expectations/isCloseTo.js.map +1 -1
  44. package/lib/expectations/isFalse.js.map +1 -1
  45. package/lib/expectations/isGreaterThan.d.ts +2 -2
  46. package/lib/expectations/isGreaterThan.d.ts.map +1 -1
  47. package/lib/expectations/isGreaterThan.js +1 -5
  48. package/lib/expectations/isGreaterThan.js.map +1 -1
  49. package/lib/expectations/isLessThan.d.ts +2 -2
  50. package/lib/expectations/isLessThan.d.ts.map +1 -1
  51. package/lib/expectations/isLessThan.js +1 -5
  52. package/lib/expectations/isLessThan.js.map +1 -1
  53. package/lib/expectations/isPresent.d.ts.map +1 -1
  54. package/lib/expectations/isPresent.js +3 -3
  55. package/lib/expectations/isPresent.js.map +1 -1
  56. package/lib/expectations/isTrue.js.map +1 -1
  57. package/lib/expectations/matches.d.ts +2 -2
  58. package/lib/expectations/matches.d.ts.map +1 -1
  59. package/lib/expectations/matches.js +1 -5
  60. package/lib/expectations/matches.js.map +1 -1
  61. package/lib/expectations/not.d.ts.map +1 -1
  62. package/lib/expectations/not.js +4 -3
  63. package/lib/expectations/not.js.map +1 -1
  64. package/lib/expectations/or.js +3 -3
  65. package/lib/expectations/or.js.map +1 -1
  66. package/lib/expectations/property.d.ts.map +1 -1
  67. package/lib/expectations/property.js +4 -3
  68. package/lib/expectations/property.js.map +1 -1
  69. package/lib/expectations/startsWith.d.ts +2 -2
  70. package/lib/expectations/startsWith.d.ts.map +1 -1
  71. package/lib/expectations/startsWith.js +1 -5
  72. package/lib/expectations/startsWith.js.map +1 -1
  73. package/package.json +4 -4
  74. package/src/Ensure.ts +27 -65
  75. package/src/expectations/and.ts +17 -13
  76. package/src/expectations/contain.ts +6 -5
  77. package/src/expectations/containAtLeastOneItemThat.ts +14 -5
  78. package/src/expectations/containItemsWhereEachItem.ts +14 -5
  79. package/src/expectations/endsWith.ts +6 -5
  80. package/src/expectations/equals.ts +6 -5
  81. package/src/expectations/includes.ts +6 -5
  82. package/src/expectations/isAfter.ts +6 -5
  83. package/src/expectations/isBefore.ts +6 -5
  84. package/src/expectations/isCloseTo.ts +14 -40
  85. package/src/expectations/isFalse.ts +1 -1
  86. package/src/expectations/isGreaterThan.ts +6 -5
  87. package/src/expectations/isLessThan.ts +6 -5
  88. package/src/expectations/isPresent.ts +5 -5
  89. package/src/expectations/isTrue.ts +1 -1
  90. package/src/expectations/matches.ts +6 -5
  91. package/src/expectations/not.ts +5 -3
  92. package/src/expectations/or.ts +6 -4
  93. package/src/expectations/property.ts +8 -5
  94. package/src/expectations/startsWith.ts +6 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
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.42](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.41...v3.0.0-rc.42) (2023-02-12)
7
+
8
+ **Note:** Version bump only for package @serenity-js/assertions
9
+
10
+
11
+
12
+
13
+
14
+ # [3.0.0-rc.41](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.40...v3.0.0-rc.41) (2023-02-07)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **assertions:** custom errors thrown via Ensure now include activity location ([1fdf7a2](https://github.com/serenity-js/serenity-js/commit/1fdf7a29aa4065d9ad23a750aa7c3cde6e36e2f1)), closes [#1102](https://github.com/serenity-js/serenity-js/issues/1102)
20
+ * **assertions:** interaction to Ensure no longer emits an AssertionReport artifact ([db3e5ae](https://github.com/serenity-js/serenity-js/commit/db3e5ae642f63ce808f52571f5ad840c614ef624)), closes [#1486](https://github.com/serenity-js/serenity-js/issues/1486)
21
+ * **core:** further improvements to how the expected vs received values are rendered in VS Code ([e2101d0](https://github.com/serenity-js/serenity-js/commit/e2101d0b11e56b1701bf75efe0d4f85ab72a6f48)), closes [#1486](https://github.com/serenity-js/serenity-js/issues/1486)
22
+ * **core:** introduced ExpectationDetails to provide more accurate info re failed expectations ([02b8f33](https://github.com/serenity-js/serenity-js/commit/02b8f33732341a9391192fc52a59ea8a8f5f19f0)), closes [#1102](https://github.com/serenity-js/serenity-js/issues/1102)
23
+
24
+
25
+ ### Features
26
+
27
+ * **core:** assertion and synchronisation errors include location of the activity that threw them ([f06f378](https://github.com/serenity-js/serenity-js/commit/f06f378b9427d81a5adcea219ef01cf616a48c20)), closes [#1102](https://github.com/serenity-js/serenity-js/issues/1102)
28
+ * **core:** assertion errors include precise information about unmet expectations and improved diffs ([1eb09b1](https://github.com/serenity-js/serenity-js/commit/1eb09b1c1c8fb059b53bd7fcefab660581abc7bc)), closes [#1102](https://github.com/serenity-js/serenity-js/issues/1102)
29
+ * **core:** better assertion errors reporting in Visual Studio Code ([3b94b7d](https://github.com/serenity-js/serenity-js/commit/3b94b7d606fae49e7ca77c2fbe09d07eeb042ea9)), closes [#1486](https://github.com/serenity-js/serenity-js/issues/1486)
30
+ * **core:** new ability to RaiseErrors ([4617d39](https://github.com/serenity-js/serenity-js/commit/4617d39a7b0d72381834abe27ff4393cbc79d0f5)), closes [#1102](https://github.com/serenity-js/serenity-js/issues/1102)
31
+
32
+
33
+
34
+
35
+
6
36
  # [3.0.0-rc.40](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.39...v3.0.0-rc.40) (2023-01-06)
7
37
 
8
38
  **Note:** Version bump only for package @serenity-js/assertions
package/README.md CHANGED
@@ -48,7 +48,7 @@ import { actorCalled } from '@serenity-js/core';
48
48
  import { Check } from '@serenity-js/assertions';
49
49
  import { Click, isVisible } from '@serenity-js/protractor';
50
50
 
51
- actorCalled('Erica').attemptsTo(
51
+ await actorCalled('Erica').attemptsTo(
52
52
  Check.whether(NewsletterModal, isVisible())
53
53
  .andIfSo(Click.on(CloseModalButton)),
54
54
  );
@@ -60,7 +60,7 @@ actorCalled('Erica').attemptsTo(
60
60
  import { actorCalled } from '@serenity-js/core';
61
61
  import { Click, isVisible, Wait } from '@serenity-js/protractor';
62
62
 
63
- actorCalled('Erica').attemptsTo(
63
+ await actorCalled('Erica').attemptsTo(
64
64
  Wait.until(CloseModalButton, isVisible()),
65
65
  Click.on(CloseModalButton)
66
66
  );
@@ -77,7 +77,7 @@ function isDivisibleBy(expected: Answerable<number>): Expectation<number> {
77
77
  .soThat((actualValue, expectedValue) => actualValue % expectedValue === 0);
78
78
  }
79
79
 
80
- actorCalled('Erica').attemptsTo(
80
+ await actorCalled('Erica').attemptsTo(
81
81
  Ensure.that(4, isDivisibleBy(2)),
82
82
  );
83
83
  ```
@@ -97,7 +97,7 @@ function isWithin(lowerBound: number, upperBound: number) {
97
97
  ));
98
98
  }
99
99
 
100
- actorCalled('Erica').attemptsTo(
100
+ await actorCalled('Erica').attemptsTo(
101
101
  Ensure.that(5, isWithin(3, 6)),
102
102
  );
103
103
  ```
package/lib/Ensure.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { Answerable, AnswersQuestions, AssertionError, CollectsArtifacts, Expectation, ExpectationOutcome, Interaction, RuntimeError, UsesAbilities } from '@serenity-js/core';
2
- import { FileSystemLocation } from '@serenity-js/core/lib/io';
1
+ import { Answerable, AnswersQuestions, CollectsArtifacts, Expectation, Interaction, RuntimeError, UsesAbilities } from '@serenity-js/core';
3
2
  /**
4
3
  * The {@apilink Interaction|interaction} to `Ensure`
5
4
  * verifies if the resolved value of the provided {@apilink Answerable}
@@ -65,7 +64,7 @@ export declare class Ensure<Actual> extends Interaction {
65
64
  * @param expectation
66
65
  * @param location
67
66
  */
68
- protected constructor(actual: Answerable<Actual>, expectation: Expectation<Actual>, location: FileSystemLocation);
67
+ private constructor();
69
68
  /**
70
69
  * @inheritDoc
71
70
  */
@@ -81,16 +80,5 @@ export declare class Ensure<Actual> extends Interaction {
81
80
  * The message explaining the failure
82
81
  */
83
82
  otherwiseFailWith(typeOfRuntimeError: new (message: string, cause?: Error) => RuntimeError, message?: string): Interaction;
84
- /**
85
- * Maps an {@apilink ExpectationOutcome} to appropriate {@apilink RuntimeError}.
86
- */
87
- protected errorForOutcome(outcome: ExpectationOutcome<any, Actual>): RuntimeError;
88
- /**
89
- * Maps an {@apilink Outcome} to {@apilink AssertionError}.
90
- *
91
- * @param outcome
92
- */
93
- protected asAssertionError(outcome: ExpectationOutcome<any, Actual>): AssertionError;
94
- private artifactFrom;
95
83
  }
96
84
  //# sourceMappingURL=Ensure.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Ensure.d.ts","sourceRoot":"","sources":["../src/Ensure.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EAEjB,WAAW,EAGX,kBAAkB,EAElB,WAAW,EAEX,YAAY,EACZ,aAAa,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAK9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,qBAAa,MAAM,CAAC,MAAM,CAAE,SAAQ,WAAW;IAqBvC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7C,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;IApBvD;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;IAIrH;;;;OAIG;IACH,SAAS,aACc,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,EAC1B,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,E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AC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB3F;;;;;;;;;OASG;IACH,iBAAiB,CAAC,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,KAAK,YAAY,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW;CAgB7H"}
package/lib/Ensure.js CHANGED
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Ensure = void 0;
4
4
  const core_1 = require("@serenity-js/core");
5
- const inspected_1 = require("@serenity-js/core/lib/io/inspected");
6
- const model_1 = require("@serenity-js/core/lib/model");
7
- const tiny_types_1 = require("tiny-types");
8
5
  /**
9
6
  * The {@apilink Interaction|interaction} to `Ensure`
10
7
  * verifies if the resolved value of the provided {@apilink Answerable}
@@ -80,15 +77,19 @@ class Ensure extends core_1.Interaction {
80
77
  */
81
78
  async performAs(actor) {
82
79
  const outcome = await actor.answer(this.expectation.isMetFor(this.actual));
83
- return (0, tiny_types_1.match)(outcome)
84
- .when(core_1.ExpectationNotMet, o => {
85
- actor.collect(this.artifactFrom(o.expected, o.actual), new model_1.Name(`Assertion Report`));
86
- throw this.errorForOutcome(o);
87
- })
88
- .when(core_1.ExpectationMet, _ => void 0)
89
- .else(o => {
90
- throw new core_1.LogicError((0, core_1.f) `Expectation#isMetFor(actual) should return an instance of an ExpectationOutcome, not ${o}`);
91
- });
80
+ if (outcome instanceof core_1.ExpectationNotMet) {
81
+ const actualDescription = (0, core_1.d) `${this.actual}`;
82
+ const message = `Expected ${actualDescription} to ${outcome.message}`;
83
+ throw core_1.RaiseErrors.as(actor).create(core_1.AssertionError, {
84
+ message,
85
+ expectation: outcome.expectation,
86
+ diff: { expected: outcome.expected, actual: outcome.actual },
87
+ location: this.instantiationLocation(),
88
+ });
89
+ }
90
+ if (!(outcome instanceof core_1.ExpectationMet)) {
91
+ throw new core_1.LogicError((0, core_1.f) `Expectation#isMetFor(actual) should return an instance of an ExpectationOutcome, not ${outcome}`);
92
+ }
92
93
  }
93
94
  /**
94
95
  * Overrides the default {@apilink AssertionError} thrown when
@@ -101,47 +102,20 @@ class Ensure extends core_1.Interaction {
101
102
  * The message explaining the failure
102
103
  */
103
104
  otherwiseFailWith(typeOfRuntimeError, message) {
104
- return new EnsureOrFailWithCustomError(this.actual, this.expectation, typeOfRuntimeError, message);
105
- }
106
- /**
107
- * Maps an {@apilink ExpectationOutcome} to appropriate {@apilink RuntimeError}.
108
- */
109
- errorForOutcome(outcome) {
110
- return this.asAssertionError(outcome);
111
- }
112
- /**
113
- * Maps an {@apilink Outcome} to {@apilink AssertionError}.
114
- *
115
- * @param outcome
116
- */
117
- asAssertionError(outcome) {
118
- const actualDescription = (0, core_1.d) `${this.actual}`;
119
- const inspectedActual = (0, inspected_1.inspected)(outcome.actual, { inline: true, markQuestions: false });
120
- const message = actualDescription === inspectedActual
121
- ? `Expected ${actualDescription} to ${outcome.message}`
122
- : `Expected ${actualDescription} to ${outcome.message} but got ${inspectedActual}`;
123
- return new core_1.AssertionError(message, outcome.expected, outcome.actual);
124
- }
125
- artifactFrom(expected, actual) {
126
- return model_1.AssertionReport.fromJSON({
127
- expected: (0, inspected_1.inspected)(expected),
128
- actual: (0, inspected_1.inspected)(actual),
105
+ const location = this.instantiationLocation();
106
+ return core_1.Interaction.where(this.toString(), async (actor) => {
107
+ try {
108
+ await this.performAs(actor);
109
+ }
110
+ catch (error) {
111
+ throw core_1.RaiseErrors.as(actor).create(typeOfRuntimeError, {
112
+ message: message !== null && message !== void 0 ? message : error.message,
113
+ location,
114
+ cause: error
115
+ });
116
+ }
129
117
  });
130
118
  }
131
119
  }
132
120
  exports.Ensure = Ensure;
133
- /**
134
- * @package
135
- */
136
- class EnsureOrFailWithCustomError extends Ensure {
137
- constructor(actual, expectation, typeOfRuntimeError, message) {
138
- super(actual, expectation, core_1.Activity.callerLocation(6));
139
- this.typeOfRuntimeError = typeOfRuntimeError;
140
- this.message = message;
141
- }
142
- errorForOutcome(outcome) {
143
- const assertionError = this.asAssertionError(outcome);
144
- return new this.typeOfRuntimeError(this.message || assertionError.message, assertionError);
145
- }
146
- }
147
121
  //# sourceMappingURL=Ensure.js.map
package/lib/Ensure.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Ensure.js","sourceRoot":"","sources":["../src/Ensure.ts"],"names":[],"mappings":";;;AAAA,4CAgB2B;AAE3B,kEAA+D;AAC/D,uDAA8E;AAC9E,2CAAmC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAa,MAAe,SAAQ,kBAAW;IAE3C;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAc,MAA+B,EAAE,WAAqC;QAC3F,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,eAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC;IAED;;;;OAIG;IACH,YACuB,MAA0B,EAC1B,WAAgC,EACnD,QAA4B;QAE5B,KAAK,CAAC,IAAA,QAAC,EAAA,uBAAwB,MAAO,SAAU,WAAY,EAAE,EAAE,QAAQ,CAAC,CAAC;QAJvD,WAAM,GAAN,MAAM,CAAoB;QAC1B,gBAAW,GAAX,WAAW,CAAqB;IAIvD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,KAA2D;QACvE,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAE3E,OAAO,IAAA,kBAAK,EAA4C,OAAO,CAAC;aAC3D,IAAI,CAAC,wBAAiB,EAAE,CAAC,CAAC,EAAE;YACzB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,MA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K,EAAE;gBACV,MAAM,kBAAW,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE;oBACnD,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,KAAK,CAAC,OAAO;oBACjC,QAAQ;oBACR,KAAK,EAAE,KAAK;iBACf,CAAC,CAAC;aACN;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA7ED,wBA6EC"}
@@ -1 +1 @@
1
- {"version":3,"file":"and.d.ts","sourceRoot":"","sources":["../../src/expectations/and.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,WAAW,EAAqB,MAAM,mBAAmB,CAAC;AAGjG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,GAAG,CAAC,WAAW,EAAE,GAAG,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,GAAG,WAAW,CAAC,WAAW,CAAC,CAE3G"}
1
+ {"version":3,"file":"and.d.ts","sourceRoot":"","sources":["../../src/expectations/and.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,WAAW,EAAyD,MAAM,mBAAmB,CAAC;AAErI;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,GAAG,CAAC,WAAW,EAAE,GAAG,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,GAAG,WAAW,CAAC,WAAW,CAAC,CAE3G"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.and = void 0;
4
4
  const core_1 = require("@serenity-js/core");
5
- const tiny_types_1 = require("tiny-types");
6
5
  /**
7
6
  * Creates an {@apilink Expectation|expectation} that is met when all the `expectations` are met for the given actual value.
8
7
  *
@@ -32,10 +31,16 @@ exports.and = and;
32
31
  */
33
32
  class And extends core_1.Expectation {
34
33
  constructor(expectations) {
35
- super(expectations.map(expectation => expectation.toString()).join(And.Separator), (actor, actual) => {
36
- return expectations.reduce((previous, current) => previous.then(outcome => (0, tiny_types_1.match)(outcome)
37
- .when(core_1.ExpectationNotMet, o => o)
38
- .else(_ => actor.answer(current.isMetFor(actual)))), Promise.resolve(void 0));
34
+ const description = expectations.map(expectation => expectation.toString()).join(And.Separator);
35
+ super('and', description, async (actor, actual) => {
36
+ let outcome;
37
+ for (const expectation of expectations) {
38
+ outcome = await actor.answer(expectation.isMetFor(actual));
39
+ if (outcome instanceof core_1.ExpectationNotMet) {
40
+ return new core_1.ExpectationNotMet(description, outcome.expectation, outcome.expected, outcome.actual);
41
+ }
42
+ }
43
+ return new core_1.ExpectationMet(description, outcome === null || outcome === void 0 ? void 0 : outcome.expectation, outcome === null || outcome === void 0 ? void 0 : outcome.expected, outcome === null || outcome === void 0 ? void 0 : outcome.actual);
39
44
  });
40
45
  this.expectations = expectations;
41
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"and.js","sourceRoot":"","sources":["../../src/expectations/and.ts"],"names":[],"mappings":";;;AAAA,4CAAiG;AACjG,2CAAmC;AAEnC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,GAAG,CAAc,GAAG,YAA6C;IAC7E,OAAO,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;AACjC,CAAC;AAFD,kBAEC;AAED;;GAEG;AACH,MAAM,GAAY,SAAQ,kBAAmB;IAGzC,YAA6B,YAAwC;QACjE,KAAK,CACD,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAC3E,CAAC,KAAuB,EAAE,MAA0B,EAAE,EAAE;YACpD,OAAO,YAAY,CAAC,MAAM,CACtB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAClB,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CACpB,IAAA,kBAAK,EAAC,OAAO,CAAC;iBACT,IAAI,CAAC,wBAAiB,EAAE,CAAC,CAAC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AAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,CAAC;QACrG,CAAC,CACJ,CAAC;QAnBuB,iBAAY,GAAZ,YAAY,CAA4B;IAoBrE,CAAC;;AAtBuB,aAAS,GAAG,OAAO,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Answerable, Expectation } from '@serenity-js/core';
1
+ import { Expectation } from '@serenity-js/core';
2
2
  /**
3
3
  * Produces an {@apilink Expectation|expectation} that is met when the actual array of `Item[]` contains
4
4
  * at least one `Item` that is equal to the resolved value of `expected`.
@@ -23,5 +23,5 @@ import { Answerable, Expectation } from '@serenity-js/core';
23
23
  *
24
24
  * @group Expectations
25
25
  */
26
- export declare function contain<Item>(expected: Answerable<Item>): Expectation<Item[]>;
26
+ export declare const contain: <Item>(expected: import("@serenity-js/core").Answerable<Item>) => Expectation<Item[]>;
27
27
  //# sourceMappingURL=contain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contain.d.ts","sourceRoot":"","sources":["../../src/expectations/contain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAG5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,CAG7E"}
1
+ {"version":3,"file":"contain.d.ts","sourceRoot":"","sources":["../../src/expectations/contain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,OAAO,uFAInB,CAAC"}
@@ -27,9 +27,5 @@ const objects_1 = require("tiny-types/lib/objects");
27
27
  *
28
28
  * @group Expectations
29
29
  */
30
- function contain(expected) {
31
- return core_1.Expectation.thatActualShould('contain', expected)
32
- .soThat((actualValue, expectedValue) => actualValue.some(item => (0, objects_1.equal)(item, expectedValue)));
33
- }
34
- exports.contain = contain;
30
+ exports.contain = core_1.Expectation.define('contain', 'contain', (actual, expected) => actual.some(item => (0, objects_1.equal)(item, expected)));
35
31
  //# sourceMappingURL=contain.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contain.js","sourceRoot":"","sources":["../../src/expectations/contain.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAC5D,oDAA+C;AAE/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,OAAO,CAAO,QAA0B;IACpD,OAAO,kBAAW,CAAC,gBAAgB,CAAe,SAAS,EAAE,QAAQ,CAAC;SACjE,MAAM,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAA,eAAK,EAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;AACtG,CAAC;AAHD,0BAGC"}
1
+ {"version":3,"file":"contain.js","sourceRoot":"","sources":["../../src/expectations/contain.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oDAA+C;AAE/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACU,QAAA,OAAO,GAAG,kBAAW,CAAC,MAAM,CACrC,SAAS,EAAE,SAAS,EACpB,CAAO,MAAc,EAAE,QAAc,EAAE,EAAE,CACrC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAA,eAAK,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CACjD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"containAtLeastOneItemThat.d.ts","sourceRoot":"","sources":["../../src/expectations/containAtLeastOneItemThat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,WAAW,EAAyD,MAAM,mBAAmB,CAAC;AAExI;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,CAEnG"}
1
+ {"version":3,"file":"containAtLeastOneItemThat.d.ts","sourceRoot":"","sources":["../../src/expectations/containAtLeastOneItemThat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,WAAW,EAAyF,MAAM,mBAAmB,CAAC;AAExK;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,CAEnG"}
@@ -35,19 +35,20 @@ class ContainAtLeastOneItemThatMeetsExpectation extends core_1.Expectation {
35
35
  return (0, core_1.d) `contain at least one item that does ${expectation}`;
36
36
  }
37
37
  constructor(expectation) {
38
- super(ContainAtLeastOneItemThatMeetsExpectation.descriptionFor(expectation), async (actor, actual) => {
38
+ super('containAtLeastOneItemThat', ContainAtLeastOneItemThatMeetsExpectation.descriptionFor(expectation), async (actor, actual) => {
39
39
  const items = await actor.answer(actual);
40
40
  if (!items || items.length === 0) {
41
- return new core_1.ExpectationNotMet(ContainAtLeastOneItemThatMeetsExpectation.descriptionFor(expectation), undefined, items);
41
+ const unanswered = new core_1.Unanswered();
42
+ return new core_1.ExpectationNotMet(ContainAtLeastOneItemThatMeetsExpectation.descriptionFor(expectation), core_1.ExpectationDetails.of('containAtLeastOneItemThat', unanswered), unanswered, items);
42
43
  }
43
44
  let outcome;
44
45
  for (const item of items) {
45
46
  outcome = await actor.answer(expectation.isMetFor(item));
46
47
  if (outcome instanceof core_1.ExpectationMet) {
47
- return new core_1.ExpectationMet(ContainAtLeastOneItemThatMeetsExpectation.descriptionFor(expectation), outcome.expected, items);
48
+ return new core_1.ExpectationMet(ContainAtLeastOneItemThatMeetsExpectation.descriptionFor(expectation), core_1.ExpectationDetails.of('containAtLeastOneItemThat', outcome.expectation), outcome.expected, items);
48
49
  }
49
50
  }
50
- return new core_1.ExpectationNotMet(ContainAtLeastOneItemThatMeetsExpectation.descriptionFor(expectation), outcome.expected, items);
51
+ return new core_1.ExpectationNotMet(ContainAtLeastOneItemThatMeetsExpectation.descriptionFor(expectation), core_1.ExpectationDetails.of('containAtLeastOneItemThat', outcome.expectation), outcome.expected, items);
51
52
  });
52
53
  this.expectation = expectation;
53
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"containAtLeastOneItemThat.js","sourceRoot":"","sources":["../../src/expectations/containAtLeastOneItemThat.ts"],"names":[],"mappings":";;;AAAA,4CAAwI;AAExI;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,yBAAyB,CAAO,WAA8B;IAC1E,OAAO,IAAI,yCAAyC,CAAC,WAAW,CAAC,CAAC;AACtE,CAAC;AAFD,8DAEC;AAED;;GAEG;AACH,MAAM,yCAAgD,SAAQ,kBAAmB;IAErE,MAAM,CAAC,cAAc,CAAC,WAA6B;QACvD,OAAO,IAAA,QAAC,EAAA,uCAAwC,WAAY,EAAE,CAAC;IACnE,CAAC;IAED,YAA6B,WAA8B;QACvD,KAAK,CACD,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,KAAK,EAAE,KAAuB,EAAE,MAA0B,EAAE,EAAE;YAE1D,MAAM,KAAK,GAAW,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAEjD,IAAI,CAAE,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC/B,OAAO,IAAI,wBAAiB,CACxB,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,SAAS,EACT,KAAK,CACR,CAAC;aACL;YAED,IAAI,OAA0C,CAAC;YAE/C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBAEtB,OAAO,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,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AC,EACrE,yBAAkB,CAAC,EAAE,CAAC,2BAA2B,EAAE,UAAU,CAAC,EAC9D,UAAU,EACV,KAAK,CACR,CAAC;aACL;YAED,IAAI,OAA2B,CAAC;YAEhC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBAEtB,OAAO,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;gBAExD,IAAI,OAAO,YAAY,qBAAc,EAAE;oBACnC,OAAO,IAAI,qBAAc,CACrB,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,yBAAkB,CAAC,EAAE,CAAC,2BAA2B,EAAE,OAAO,CAAC,WAAW,CAAC,EACvE,OAAO,CAAC,QAAQ,EAChB,KAAK,CACR,CAAC;iBACL;aACJ;YAED,OAAO,IAAI,wBAAiB,CACxB,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,yBAAkB,CAAC,EAAE,CAAC,2BAA2B,EAAE,OAAO,CAAC,WAAW,CAAC,EACvE,OAAO,CAAC,QAAQ,EAChB,KAAK,CACR,CAAC;QACN,CAAC,CACJ,CAAC;QAzCuB,gBAAW,GAAX,WAAW,CAAmB;IA0C3D,CAAC;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"containItemsWhereEachItem.d.ts","sourceRoot":"","sources":["../../src/expectations/containItemsWhereEachItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,WAAW,EAAyD,MAAM,mBAAmB,CAAC;AAExI;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAEzG"}
1
+ {"version":3,"file":"containItemsWhereEachItem.d.ts","sourceRoot":"","sources":["../../src/expectations/containItemsWhereEachItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,WAAW,EAAyF,MAAM,mBAAmB,CAAC;AAExK;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAEzG"}
@@ -35,19 +35,20 @@ class ContainItemsWhereEachItemMeetsExpectation extends core_1.Expectation {
35
35
  return (0, core_1.d) `contain items where each item does ${expectation}`;
36
36
  }
37
37
  constructor(expectation) {
38
- super(ContainItemsWhereEachItemMeetsExpectation.descriptionFor(expectation), async (actor, actual) => {
38
+ super('containItemsWhereEachItem', ContainItemsWhereEachItemMeetsExpectation.descriptionFor(expectation), async (actor, actual) => {
39
39
  const items = await actor.answer(actual);
40
40
  if (!items || items.length === 0) {
41
- return new core_1.ExpectationNotMet(ContainItemsWhereEachItemMeetsExpectation.descriptionFor(expectation), undefined, items);
41
+ const unanswered = new core_1.Unanswered();
42
+ return new core_1.ExpectationNotMet(ContainItemsWhereEachItemMeetsExpectation.descriptionFor(expectation), core_1.ExpectationDetails.of('containItemsWhereEachItem', unanswered), unanswered, items);
42
43
  }
43
44
  let outcome;
44
45
  for (const item of items) {
45
46
  outcome = await actor.answer(expectation.isMetFor(item));
46
47
  if (outcome instanceof core_1.ExpectationNotMet) {
47
- return new core_1.ExpectationNotMet(ContainItemsWhereEachItemMeetsExpectation.descriptionFor(expectation), outcome.expected, items);
48
+ return new core_1.ExpectationNotMet(ContainItemsWhereEachItemMeetsExpectation.descriptionFor(expectation), core_1.ExpectationDetails.of('containItemsWhereEachItem', outcome.expectation), outcome.expected, items);
48
49
  }
49
50
  }
50
- return new core_1.ExpectationMet(ContainItemsWhereEachItemMeetsExpectation.descriptionFor(expectation), outcome.expected, items);
51
+ return new core_1.ExpectationMet(ContainItemsWhereEachItemMeetsExpectation.descriptionFor(expectation), core_1.ExpectationDetails.of('containItemsWhereEachItem', outcome.expectation), outcome.expected, items);
51
52
  });
52
53
  this.expectation = expectation;
53
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"containItemsWhereEachItem.js","sourceRoot":"","sources":["../../src/expectations/containItemsWhereEachItem.ts"],"names":[],"mappings":";;;AAAA,4CAAwI;AAExI;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,yBAAyB,CAAS,WAAgC;IAC9E,OAAO,IAAI,yCAAyC,CAAC,WAAW,CAAC,CAAC;AACtE,CAAC;AAFD,8DAEC;AAED;;GAEG;AACH,MAAM,yCAAkD,SAAQ,kBAAqB;IAEzE,MAAM,CAAC,cAAc,CAAC,WAA6B;QACvD,OAAO,IAAA,QAAC,EAAA,sCAAuC,WAAY,EAAE,CAAC;IAClE,CAAC;IAED,YAA6B,WAAgC;QACzD,KAAK,CACD,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,KAAK,EAAE,KAAuB,EAAE,MAA4B,EAAE,EAAE;YAE5D,MAAM,KAAK,GAAa,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAEnD,IAAI,CAAE,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC/B,OAAO,IAAI,wBAAiB,CACxB,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,SAAS,EACT,KAAK,CACR,CAAC;aACL;YAED,IAAI,OAA4C,CAAC;YAEjD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBAEtB,OAAO,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;gBAExD,IAAI,OAAO,YAAY,wBAAiB,EAAE;oBACtC,OAAO,IAAI,wBAAiB,CACxB,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,OAAO,CAAC,QAAQ,EAChB,KAAK,CACR,CAAC;iBACL;aACJ;YAED,OAAO,IAAI,qBAAc,CAAC,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC9H,CAAC,CACJ,CAAC;QAhCuB,gBAAW,GAAX,WAAW,CAAqB;IAiC7D,CAAC;CACJ"}
1
+ {"version":3,"file":"containItemsWhereEachItem.js","sourceRoot":"","sources":["../../src/expectations/containItemsWhereEachItem.ts"],"names":[],"mappings":";;;AAAA,4CAAwK;AAExK;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,yBAAyB,CAAS,WAAgC;IAC9E,OAAO,IAAI,yCAAyC,CAAC,WAAW,CAAC,CAAC;AACtE,CAAC;AAFD,8DAEC;AAED;;GAEG;AACH,MAAM,yCAAkD,SAAQ,kBAAqB;IAEzE,MAAM,CAAC,cAAc,CAAC,WAA6B;QACvD,OAAO,IAAA,QAAC,EAAA,sCAAuC,WAAY,EAAE,CAAC;IAClE,CAAC;IAED,YAA6B,WAAgC;QACzD,KAAK,CACD,2BAA2B,EAC3B,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,KAAK,EAAE,KAAuB,EAAE,MAA4B,EAAE,EAAE;YAE5D,MAAM,KAAK,GAAa,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAEnD,IAAI,CAAE,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC/B,MAAM,UAAU,GAAG,IAAI,iBAAU,EAAE,CAAC;gBACpC,OAAO,IAAI,wBAAiB,CACxB,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,yBAAkB,CAAC,EAAE,CAAC,2BAA2B,EAAE,UAAU,CAAC,EAC9D,UAAU,EACV,KAAK,CACR,CAAC;aACL;YAED,IAAI,OAA2B,CAAC;YAEhC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBAEtB,OAAO,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;gBAExD,IAAI,OAAO,YAAY,wBAAiB,EAAE;oBACtC,OAAO,IAAI,wBAAiB,CACxB,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,yBAAkB,CAAC,EAAE,CAAC,2BAA2B,EAAE,OAAO,CAAC,WAAW,CAAC,EACvE,OAAO,CAAC,QAAQ,EAChB,KAAK,CACR,CAAC;iBACL;aACJ;YAED,OAAO,IAAI,qBAAc,CACrB,yCAAyC,CAAC,cAAc,CAAC,WAAW,CAAC,EACrE,yBAAkB,CAAC,EAAE,CAAC,2BAA2B,EAAE,OAAO,CAAC,WAAW,CAAC,EACvE,OAAO,CAAC,QAAQ,EAChB,KAAK,CACR,CAAC;QACN,CAAC,CACJ,CAAC;QAzCuB,gBAAW,GAAX,WAAW,CAAqB;IA0C7D,CAAC;CACJ"}
@@ -1,4 +1,4 @@
1
- import { Answerable, Expectation } from '@serenity-js/core';
1
+ import { Expectation } from '@serenity-js/core';
2
2
  /**
3
3
  * Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
4
4
  * ends with the resolved value of `expected`.
@@ -18,5 +18,5 @@ import { Answerable, Expectation } from '@serenity-js/core';
18
18
  *
19
19
  * @group Expectations
20
20
  */
21
- export declare function endsWith(expected: Answerable<string>): Expectation<string>;
21
+ export declare const endsWith: (expected: import("@serenity-js/core").Answerable<string>) => Expectation<string>;
22
22
  //# sourceMappingURL=endsWith.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"endsWith.d.ts","sourceRoot":"","sources":["../../src/expectations/endsWith.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAG1E"}
1
+ {"version":3,"file":"endsWith.d.ts","sourceRoot":"","sources":["../../src/expectations/endsWith.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,QAAQ,mFAIpB,CAAA"}
@@ -21,9 +21,5 @@ const core_1 = require("@serenity-js/core");
21
21
  *
22
22
  * @group Expectations
23
23
  */
24
- function endsWith(expected) {
25
- return core_1.Expectation.thatActualShould('end with', expected)
26
- .soThat((actualValue, expectedValue) => actualValue.endsWith(expectedValue));
27
- }
28
- exports.endsWith = endsWith;
24
+ exports.endsWith = core_1.Expectation.define('endsWith', 'end with', (actual, expected) => actual.endsWith(expected));
29
25
  //# sourceMappingURL=endsWith.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"endsWith.js","sourceRoot":"","sources":["../../src/expectations/endsWith.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,QAAQ,CAAC,QAA4B;IACjD,OAAO,kBAAW,CAAC,gBAAgB,CAAiB,UAAU,EAAE,QAAQ,CAAC;SACpE,MAAM,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AACrF,CAAC;AAHD,4BAGC"}
1
+ {"version":3,"file":"endsWith.js","sourceRoot":"","sources":["../../src/expectations/endsWith.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,QAAQ,GAAG,kBAAW,CAAC,MAAM,CACtC,UAAU,EAAE,UAAU,EACtB,CAAC,MAAc,EAAE,QAAgB,EAAE,EAAE,CACjC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAChC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Answerable, Expectation } from '@serenity-js/core';
1
+ import { Expectation } from '@serenity-js/core';
2
2
  /**
3
3
  * Produces an {@apilink Expectation|expectation} that is met when the actual value
4
4
  * is equal to the resolved value of `expectedValue`.
@@ -24,5 +24,5 @@ import { Answerable, Expectation } from '@serenity-js/core';
24
24
  *
25
25
  * @group Expectations
26
26
  */
27
- export declare function equals<Expected>(expectedValue: Answerable<Expected>): Expectation<Expected>;
27
+ export declare const equals: <T>(expected: import("@serenity-js/core").Answerable<T>) => Expectation<T>;
28
28
  //# sourceMappingURL=equals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"equals.d.ts","sourceRoot":"","sources":["../../src/expectations/equals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,CAG3F"}
1
+ {"version":3,"file":"equals.d.ts","sourceRoot":"","sources":["../../src/expectations/equals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,MAAM,4EAIlB,CAAC"}
@@ -28,9 +28,5 @@ const objects_1 = require("tiny-types/lib/objects");
28
28
  *
29
29
  * @group Expectations
30
30
  */
31
- function equals(expectedValue) {
32
- return core_1.Expectation.thatActualShould('equal', expectedValue)
33
- .soThat((actual, expected) => (0, objects_1.equal)(actual, expected));
34
- }
35
- exports.equals = equals;
31
+ exports.equals = core_1.Expectation.define('equals', 'equal', (actual, expected) => (0, objects_1.equal)(actual, expected));
36
32
  //# sourceMappingURL=equals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"equals.js","sourceRoot":"","sources":["../../src/expectations/equals.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAC5D,oDAA+C;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,MAAM,CAAW,aAAmC;IAChE,OAAO,kBAAW,CAAC,gBAAgB,CAAqB,OAAO,EAAE,aAAa,CAAC;SAC1E,MAAM,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAA,eAAK,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC/D,CAAC;AAHD,wBAGC"}
1
+ {"version":3,"file":"equals.js","sourceRoot":"","sources":["../../src/expectations/equals.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,oDAA+C;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACU,QAAA,MAAM,GAAG,kBAAW,CAAC,MAAM,CACpC,QAAQ,EAAE,OAAO,EACjB,CAAI,MAAS,EAAE,QAAW,EAAE,EAAE,CAC1B,IAAA,eAAK,EAAC,MAAM,EAAE,QAAQ,CAAC,CAC9B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Answerable, Expectation } from '@serenity-js/core';
1
+ import { Expectation } from '@serenity-js/core';
2
2
  /**
3
3
  * Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
4
4
  * includes a substring of `expected`.
@@ -18,5 +18,5 @@ import { Answerable, Expectation } from '@serenity-js/core';
18
18
  *
19
19
  * @group Expectations
20
20
  */
21
- export declare function includes(expected: Answerable<string>): Expectation<string>;
21
+ export declare const includes: (expected: import("@serenity-js/core").Answerable<string>) => Expectation<string>;
22
22
  //# sourceMappingURL=includes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"includes.d.ts","sourceRoot":"","sources":["../../src/expectations/includes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAG1E"}
1
+ {"version":3,"file":"includes.d.ts","sourceRoot":"","sources":["../../src/expectations/includes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,QAAQ,mFAIpB,CAAC"}
@@ -21,9 +21,5 @@ const core_1 = require("@serenity-js/core");
21
21
  *
22
22
  * @group Expectations
23
23
  */
24
- function includes(expected) {
25
- return core_1.Expectation.thatActualShould('include', expected)
26
- .soThat((actualValue, expectedValue) => actualValue.includes(expectedValue));
27
- }
28
- exports.includes = includes;
24
+ exports.includes = core_1.Expectation.define('includes', 'include', (actual, expected) => actual.includes(expected));
29
25
  //# sourceMappingURL=includes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"includes.js","sourceRoot":"","sources":["../../src/expectations/includes.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,QAAQ,CAAC,QAA4B;IACjD,OAAO,kBAAW,CAAC,gBAAgB,CAAiB,SAAS,EAAE,QAAQ,CAAC;SACnE,MAAM,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AACrF,CAAC;AAHD,4BAGC"}
1
+ {"version":3,"file":"includes.js","sourceRoot":"","sources":["../../src/expectations/includes.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,QAAQ,GAAG,kBAAW,CAAC,MAAM,CACtC,UAAU,EAAE,SAAS,EACrB,CAAC,MAAc,EAAE,QAAgB,EAAE,EAAE,CACjC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAChC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Answerable, Expectation } from '@serenity-js/core';
1
+ import { Expectation } from '@serenity-js/core';
2
2
  /**
3
3
  * Creates an {@apilink Expectation|expectation} that is met when the actual value of type `Date`
4
4
  * is after the expected `Date`.
@@ -38,5 +38,5 @@ import { Answerable, Expectation } from '@serenity-js/core';
38
38
  *
39
39
  * @group Expectations
40
40
  */
41
- export declare function isAfter(expected: Answerable<Date>): Expectation<Date>;
41
+ export declare const isAfter: (expected: import("@serenity-js/core").Answerable<Date>) => Expectation<Date>;
42
42
  //# sourceMappingURL=isAfter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isAfter.d.ts","sourceRoot":"","sources":["../../src/expectations/isAfter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAGrE"}
1
+ {"version":3,"file":"isAfter.d.ts","sourceRoot":"","sources":["../../src/expectations/isAfter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,OAAO,+EAInB,CAAC"}
@@ -41,9 +41,5 @@ const core_1 = require("@serenity-js/core");
41
41
  *
42
42
  * @group Expectations
43
43
  */
44
- function isAfter(expected) {
45
- return core_1.Expectation.thatActualShould('have value that is after', expected)
46
- .soThat((actualValue, expectedValue) => actualValue.getTime() > expectedValue.getTime());
47
- }
48
- exports.isAfter = isAfter;
44
+ exports.isAfter = core_1.Expectation.define('isAfter', 'have value that is after', (actual, expected) => actual.getTime() > expected.getTime());
49
45
  //# sourceMappingURL=isAfter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isAfter.js","sourceRoot":"","sources":["../../src/expectations/isAfter.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,SAAgB,OAAO,CAAC,QAA0B;IAC9C,OAAO,kBAAW,CAAC,gBAAgB,CAAa,0BAA0B,EAAE,QAAQ,CAAC;SAChF,MAAM,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;AACjG,CAAC;AAHD,0BAGC"}
1
+ {"version":3,"file":"isAfter.js","sourceRoot":"","sources":["../../src/expectations/isAfter.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACU,QAAA,OAAO,GAAG,kBAAW,CAAC,MAAM,CACrC,SAAS,EAAE,0BAA0B,EACrC,CAAC,MAAY,EAAE,QAAc,EAAE,EAAE,CAC7B,MAAM,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,CAC5C,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Answerable, Expectation } from '@serenity-js/core';
1
+ import { Expectation } from '@serenity-js/core';
2
2
  /**
3
3
  * Creates an {@apilink Expectation|expectation} that is met when the actual value of type `Date`
4
4
  * is before the expected `Date`.
@@ -38,5 +38,5 @@ import { Answerable, Expectation } from '@serenity-js/core';
38
38
  *
39
39
  * @group Expectations
40
40
  */
41
- export declare function isBefore(expected: Answerable<Date>): Expectation<Date>;
41
+ export declare const isBefore: (expected: import("@serenity-js/core").Answerable<Date>) => Expectation<Date>;
42
42
  //# sourceMappingURL=isBefore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isBefore.d.ts","sourceRoot":"","sources":["../../src/expectations/isBefore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAGtE"}
1
+ {"version":3,"file":"isBefore.d.ts","sourceRoot":"","sources":["../../src/expectations/isBefore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,QAAQ,+EAIpB,CAAC"}
@@ -41,9 +41,5 @@ const core_1 = require("@serenity-js/core");
41
41
  *
42
42
  * @group Expectations
43
43
  */
44
- function isBefore(expected) {
45
- return core_1.Expectation.thatActualShould('have value that is before', expected)
46
- .soThat((actualValue, expectedValue) => actualValue.getTime() < expectedValue.getTime());
47
- }
48
- exports.isBefore = isBefore;
44
+ exports.isBefore = core_1.Expectation.define('isBefore', 'have value that is before', (actual, expected) => actual.getTime() < expected.getTime());
49
45
  //# sourceMappingURL=isBefore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isBefore.js","sourceRoot":"","sources":["../../src/expectations/isBefore.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,SAAgB,QAAQ,CAAC,QAA0B;IAC/C,OAAO,kBAAW,CAAC,gBAAgB,CAAa,2BAA2B,EAAE,QAAQ,CAAC;SACjF,MAAM,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;AACjG,CAAC;AAHD,4BAGC"}
1
+ {"version":3,"file":"isBefore.js","sourceRoot":"","sources":["../../src/expectations/isBefore.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACU,QAAA,QAAQ,GAAG,kBAAW,CAAC,MAAM,CACtC,UAAU,EAAE,2BAA2B,EACvC,CAAC,MAAY,EAAE,QAAc,EAAE,EAAE,CAC7B,MAAM,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,CAC5C,CAAC"}