@serenity-js/assertions 3.41.1 → 3.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/esm/Ensure.d.ts +110 -0
- package/esm/Ensure.d.ts.map +1 -0
- package/esm/Ensure.js +148 -0
- package/esm/Ensure.js.map +1 -0
- package/esm/EnsureEventually.d.ts +98 -0
- package/esm/EnsureEventually.d.ts.map +1 -0
- package/esm/EnsureEventually.js +142 -0
- package/esm/EnsureEventually.js.map +1 -0
- package/esm/expectations/and.d.ts +23 -0
- package/esm/expectations/and.d.ts.map +1 -0
- package/esm/expectations/and.js +46 -0
- package/esm/expectations/and.js.map +1 -0
- package/esm/expectations/contain.d.ts +27 -0
- package/esm/expectations/contain.d.ts.map +1 -0
- package/esm/expectations/contain.js +28 -0
- package/esm/expectations/contain.js.map +1 -0
- package/esm/expectations/containAtLeastOneItemThat.d.ts +24 -0
- package/esm/expectations/containAtLeastOneItemThat.d.ts.map +1 -0
- package/esm/expectations/containAtLeastOneItemThat.js +53 -0
- package/esm/expectations/containAtLeastOneItemThat.js.map +1 -0
- package/esm/expectations/containItemsWhereEachItem.d.ts +24 -0
- package/esm/expectations/containItemsWhereEachItem.d.ts.map +1 -0
- package/esm/expectations/containItemsWhereEachItem.js +53 -0
- package/esm/expectations/containItemsWhereEachItem.js.map +1 -0
- package/esm/expectations/endsWith.d.ts +22 -0
- package/esm/expectations/endsWith.d.ts.map +1 -0
- package/esm/expectations/endsWith.js +22 -0
- package/esm/expectations/endsWith.js.map +1 -0
- package/esm/expectations/equals.d.ts +28 -0
- package/esm/expectations/equals.d.ts.map +1 -0
- package/esm/expectations/equals.js +29 -0
- package/esm/expectations/equals.js.map +1 -0
- package/esm/expectations/includes.d.ts +41 -0
- package/esm/expectations/includes.d.ts.map +1 -0
- package/esm/expectations/includes.js +41 -0
- package/esm/expectations/includes.js.map +1 -0
- package/esm/expectations/index.d.ts +21 -0
- package/esm/expectations/index.d.ts.map +1 -0
- package/esm/expectations/index.js +21 -0
- package/esm/expectations/index.js.map +1 -0
- package/esm/expectations/isAfter.d.ts +42 -0
- package/esm/expectations/isAfter.d.ts.map +1 -0
- package/esm/expectations/isAfter.js +50 -0
- package/esm/expectations/isAfter.js.map +1 -0
- package/esm/expectations/isBefore.d.ts +42 -0
- package/esm/expectations/isBefore.d.ts.map +1 -0
- package/esm/expectations/isBefore.js +50 -0
- package/esm/expectations/isBefore.js.map +1 -0
- package/esm/expectations/isCloseTo.d.ts +24 -0
- package/esm/expectations/isCloseTo.d.ts.map +1 -0
- package/esm/expectations/isCloseTo.js +34 -0
- package/esm/expectations/isCloseTo.js.map +1 -0
- package/esm/expectations/isFalse.d.ts +21 -0
- package/esm/expectations/isFalse.d.ts.map +1 -0
- package/esm/expectations/isFalse.js +24 -0
- package/esm/expectations/isFalse.js.map +1 -0
- package/esm/expectations/isGreaterThan.d.ts +45 -0
- package/esm/expectations/isGreaterThan.d.ts.map +1 -0
- package/esm/expectations/isGreaterThan.js +45 -0
- package/esm/expectations/isGreaterThan.js.map +1 -0
- package/esm/expectations/isLessThan.d.ts +45 -0
- package/esm/expectations/isLessThan.d.ts.map +1 -0
- package/esm/expectations/isLessThan.js +45 -0
- package/esm/expectations/isLessThan.js.map +1 -0
- package/esm/expectations/isPresent.d.ts +65 -0
- package/esm/expectations/isPresent.d.ts.map +1 -0
- package/esm/expectations/isPresent.js +96 -0
- package/esm/expectations/isPresent.js.map +1 -0
- package/esm/expectations/isTrue.d.ts +21 -0
- package/esm/expectations/isTrue.d.ts.map +1 -0
- package/esm/expectations/isTrue.js +24 -0
- package/esm/expectations/isTrue.js.map +1 -0
- package/esm/expectations/matches.d.ts +22 -0
- package/esm/expectations/matches.d.ts.map +1 -0
- package/esm/expectations/matches.js +22 -0
- package/esm/expectations/matches.js.map +1 -0
- package/esm/expectations/not.d.ts +24 -0
- package/esm/expectations/not.d.ts.map +1 -0
- package/esm/expectations/not.js +48 -0
- package/esm/expectations/not.js.map +1 -0
- package/esm/expectations/or.d.ts +23 -0
- package/esm/expectations/or.d.ts.map +1 -0
- package/esm/expectations/or.js +53 -0
- package/esm/expectations/or.js.map +1 -0
- package/esm/expectations/property.d.ts +62 -0
- package/esm/expectations/property.d.ts.map +1 -0
- package/esm/expectations/property.js +82 -0
- package/esm/expectations/property.js.map +1 -0
- package/esm/expectations/startsWith.d.ts +22 -0
- package/esm/expectations/startsWith.d.ts.map +1 -0
- package/esm/expectations/startsWith.js +22 -0
- package/esm/expectations/startsWith.js.map +1 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +4 -0
- package/esm/index.js.map +1 -0
- package/lib/Ensure.d.ts +1 -1
- package/lib/Ensure.d.ts.map +1 -1
- package/lib/Ensure.js +2 -2
- package/lib/Ensure.js.map +1 -1
- package/lib/EnsureEventually.d.ts +1 -1
- package/lib/EnsureEventually.d.ts.map +1 -1
- package/lib/expectations/contain.js +2 -2
- package/lib/expectations/contain.js.map +1 -1
- package/lib/expectations/equals.js +2 -2
- package/lib/expectations/equals.js.map +1 -1
- package/lib/expectations/index.d.ts +20 -20
- package/lib/expectations/index.d.ts.map +1 -1
- package/lib/expectations/index.js +20 -20
- package/lib/expectations/index.js.map +1 -1
- package/lib/expectations/isAfter.d.ts +1 -1
- package/lib/expectations/isBefore.d.ts +1 -1
- package/lib/expectations/isFalse.js +2 -2
- package/lib/expectations/isFalse.js.map +1 -1
- package/lib/expectations/isTrue.js +2 -2
- package/lib/expectations/isTrue.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -0
- package/package.json +31 -8
- package/src/Ensure.ts +2 -2
- package/src/EnsureEventually.ts +1 -1
- package/src/expectations/contain.ts +1 -1
- package/src/expectations/equals.ts +1 -1
- package/src/expectations/index.ts +20 -20
- package/src/expectations/isFalse.ts +1 -1
- package/src/expectations/isTrue.ts +1 -1
- package/src/index.ts +3 -3
- package/tsconfig-cjs.build.json +17 -0
- package/tsconfig-esm.build.json +18 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Expectation } from '@serenity-js/core';
|
|
2
|
+
/**
|
|
3
|
+
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that negates the provided `expectation`.
|
|
4
|
+
*
|
|
5
|
+
* ## Ensuring that the actual value does not equal the expected value
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
9
|
+
* import { Ensure, equals, not } from '@serenity-js/assertions'
|
|
10
|
+
*
|
|
11
|
+
* const actual = { name: 'apples' }
|
|
12
|
+
* const expected = { name: 'bananas' }
|
|
13
|
+
*
|
|
14
|
+
* await actorCalled('Ester').attemptsTo(
|
|
15
|
+
* Ensure.that(actual, not(equals(expected))),
|
|
16
|
+
* )
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param expectation
|
|
20
|
+
*
|
|
21
|
+
* @group Expectations
|
|
22
|
+
*/
|
|
23
|
+
export declare function not<Actual>(expectation: Expectation<Actual>): Expectation<Actual>;
|
|
24
|
+
//# sourceMappingURL=not.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not.d.ts","sourceRoot":"","sources":["../../src/expectations/not.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAyD,MAAM,mBAAmB,CAAC;AAEvG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAEjF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Expectation, ExpectationDetails, ExpectationMet, ExpectationNotMet } from '@serenity-js/core';
|
|
2
|
+
/**
|
|
3
|
+
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that negates the provided `expectation`.
|
|
4
|
+
*
|
|
5
|
+
* ## Ensuring that the actual value does not equal the expected value
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
9
|
+
* import { Ensure, equals, not } from '@serenity-js/assertions'
|
|
10
|
+
*
|
|
11
|
+
* const actual = { name: 'apples' }
|
|
12
|
+
* const expected = { name: 'bananas' }
|
|
13
|
+
*
|
|
14
|
+
* await actorCalled('Ester').attemptsTo(
|
|
15
|
+
* Ensure.that(actual, not(equals(expected))),
|
|
16
|
+
* )
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param expectation
|
|
20
|
+
*
|
|
21
|
+
* @group Expectations
|
|
22
|
+
*/
|
|
23
|
+
export function not(expectation) {
|
|
24
|
+
return new Not(expectation);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @package
|
|
28
|
+
*/
|
|
29
|
+
class Not extends Expectation {
|
|
30
|
+
expectation;
|
|
31
|
+
static flipped(message) {
|
|
32
|
+
return message.startsWith('not ')
|
|
33
|
+
? message.slice(4)
|
|
34
|
+
: `not ${message}`;
|
|
35
|
+
}
|
|
36
|
+
constructor(expectation) {
|
|
37
|
+
super('not', Not.flipped(expectation.toString()), async (actor, actual) => {
|
|
38
|
+
const subject = Not.flipped(expectation.toString());
|
|
39
|
+
const outcome = await actor.answer(expectation.isMetFor(actual));
|
|
40
|
+
const expectationDetails = ExpectationDetails.of('not', outcome.expectation);
|
|
41
|
+
return outcome instanceof ExpectationNotMet
|
|
42
|
+
? new ExpectationMet(subject, expectationDetails, outcome.expected, outcome.actual)
|
|
43
|
+
: new ExpectationNotMet(subject, expectationDetails, outcome.expected, outcome.actual);
|
|
44
|
+
});
|
|
45
|
+
this.expectation = expectation;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=not.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not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G,CAAC,CACJ,CAAC;QAduB,gBAAW,GAAX,WAAW,CAAqB;IAe7D,CAAC;CACJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Expectation } from '@serenity-js/core';
|
|
2
|
+
/**
|
|
3
|
+
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when at least one of the `expectations` is met for the given actual value.
|
|
4
|
+
*
|
|
5
|
+
* Use `or` to combine several expectations using logical "or",
|
|
6
|
+
*
|
|
7
|
+
* ## Combining several expectations
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
11
|
+
* import { Ensure, or, startsWith } from '@serenity-js/assertions'
|
|
12
|
+
*
|
|
13
|
+
* await actorCalled('Ester').attemptsTo(
|
|
14
|
+
* Ensure.that('Hello World!', or(startsWith('Hello'), startsWith('Hi'))),
|
|
15
|
+
* )
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @param expectations
|
|
19
|
+
*
|
|
20
|
+
* @group Expectations
|
|
21
|
+
*/
|
|
22
|
+
export declare function or<Actual_Type>(...expectations: Array<Expectation<Actual_Type>>): Expectation<Actual_Type>;
|
|
23
|
+
//# sourceMappingURL=or.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"or.d.ts","sourceRoot":"","sources":["../../src/expectations/or.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAiD,MAAM,mBAAmB,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,EAAE,CAAC,WAAW,EAAE,GAAG,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,GAAG,WAAW,CAAC,WAAW,CAAC,CAE1G"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Expectation, ExpectationMet, ExpectationNotMet, LogicError } from '@serenity-js/core';
|
|
2
|
+
/**
|
|
3
|
+
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when at least one of the `expectations` is met for the given actual value.
|
|
4
|
+
*
|
|
5
|
+
* Use `or` to combine several expectations using logical "or",
|
|
6
|
+
*
|
|
7
|
+
* ## Combining several expectations
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
11
|
+
* import { Ensure, or, startsWith } from '@serenity-js/assertions'
|
|
12
|
+
*
|
|
13
|
+
* await actorCalled('Ester').attemptsTo(
|
|
14
|
+
* Ensure.that('Hello World!', or(startsWith('Hello'), startsWith('Hi'))),
|
|
15
|
+
* )
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @param expectations
|
|
19
|
+
*
|
|
20
|
+
* @group Expectations
|
|
21
|
+
*/
|
|
22
|
+
export function or(...expectations) {
|
|
23
|
+
return new Or(expectations);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @package
|
|
27
|
+
*/
|
|
28
|
+
class Or extends Expectation {
|
|
29
|
+
expectations;
|
|
30
|
+
static Separator = ' or ';
|
|
31
|
+
static subjectFor(expectations) {
|
|
32
|
+
return expectations
|
|
33
|
+
.map(expectation => expectation.toString())
|
|
34
|
+
.join(Or.Separator);
|
|
35
|
+
}
|
|
36
|
+
constructor(expectations) {
|
|
37
|
+
super('or', Or.subjectFor(expectations), async (actor, actual) => {
|
|
38
|
+
if (!expectations || expectations.length === 0) {
|
|
39
|
+
throw new LogicError(`No expectations provided to or()`);
|
|
40
|
+
}
|
|
41
|
+
let outcome;
|
|
42
|
+
for (const expectation of expectations) {
|
|
43
|
+
outcome = await actor.answer(expectation.isMetFor(actual));
|
|
44
|
+
if (outcome instanceof ExpectationMet) {
|
|
45
|
+
return outcome;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return new ExpectationNotMet(Or.subjectFor(expectations), outcome.expectation, outcome.expected, outcome.actual);
|
|
49
|
+
});
|
|
50
|
+
this.expectations = expectations;
|
|
51
|
+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AAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAC3B,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,QAAQ,EAChB,OAAO,CAAC,MAAM,CACjB,CAAC;QACN,CAAC,CACJ,CAAC;QAzBuB,iBAAY,GAAZ,YAAY,CAA4B;IA0BrE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Expectation } from '@serenity-js/core';
|
|
2
|
+
/**
|
|
3
|
+
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the value of
|
|
4
|
+
* the `actual[propertyName]` meets the `expectation`.
|
|
5
|
+
*
|
|
6
|
+
* ## Ensuring that an array has an item
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
10
|
+
* import { Ensure, property } from '@serenity-js/assertions'
|
|
11
|
+
*
|
|
12
|
+
* const list = [ 'hello', 'world' ]
|
|
13
|
+
*
|
|
14
|
+
* await actorCalled('Ester').attemptsTo(
|
|
15
|
+
* Ensure.that(list, property(0, isPresent())),
|
|
16
|
+
* )
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* ## Ensuring that the property meets an expectation
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
23
|
+
* import { Ensure, property, equals } from '@serenity-js/assertions'
|
|
24
|
+
*
|
|
25
|
+
* const list = [ 'hello', 'world' ]
|
|
26
|
+
*
|
|
27
|
+
* await actorCalled('Ester').attemptsTo(
|
|
28
|
+
* Ensure.that(list, property('length', equals(2))),
|
|
29
|
+
* )
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* ## Asserting on a list of objects
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
36
|
+
* import { Ensure, property, equals } from '@serenity-js/assertions'
|
|
37
|
+
*
|
|
38
|
+
* const developers = [{
|
|
39
|
+
* name: 'Jan',
|
|
40
|
+
* id: '@jan-molak',
|
|
41
|
+
* }, {
|
|
42
|
+
* name: 'John',
|
|
43
|
+
* id: '@wakaleo',
|
|
44
|
+
* }]
|
|
45
|
+
*
|
|
46
|
+
* await actorCalled('Ester').attemptsTo(
|
|
47
|
+
* Ensure.that(
|
|
48
|
+
* developers,
|
|
49
|
+
* containItemsWhereEachItem(
|
|
50
|
+
* property('id', startsWith('@'))
|
|
51
|
+
* ),
|
|
52
|
+
* ),
|
|
53
|
+
* )
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @param propertyName
|
|
57
|
+
* @param expectation
|
|
58
|
+
*
|
|
59
|
+
* @group Expectations
|
|
60
|
+
*/
|
|
61
|
+
export declare function property<Actual extends object, PropertyName extends keyof Actual>(propertyName: PropertyName, expectation: Expectation<Actual[PropertyName]>): Expectation<Actual>;
|
|
62
|
+
//# sourceMappingURL=property.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../src/expectations/property.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAyD,MAAM,mBAAmB,CAAC;AAEvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAgB,QAAQ,CAAC,MAAM,SAAS,MAAM,EAAE,YAAY,SAAS,MAAM,MAAM,EAC7E,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,GAC/C,WAAW,CAAC,MAAM,CAAC,CAErB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Expectation, ExpectationDetails, ExpectationMet, ExpectationNotMet } from '@serenity-js/core';
|
|
2
|
+
/**
|
|
3
|
+
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the value of
|
|
4
|
+
* the `actual[propertyName]` meets the `expectation`.
|
|
5
|
+
*
|
|
6
|
+
* ## Ensuring that an array has an item
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
10
|
+
* import { Ensure, property } from '@serenity-js/assertions'
|
|
11
|
+
*
|
|
12
|
+
* const list = [ 'hello', 'world' ]
|
|
13
|
+
*
|
|
14
|
+
* await actorCalled('Ester').attemptsTo(
|
|
15
|
+
* Ensure.that(list, property(0, isPresent())),
|
|
16
|
+
* )
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* ## Ensuring that the property meets an expectation
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
23
|
+
* import { Ensure, property, equals } from '@serenity-js/assertions'
|
|
24
|
+
*
|
|
25
|
+
* const list = [ 'hello', 'world' ]
|
|
26
|
+
*
|
|
27
|
+
* await actorCalled('Ester').attemptsTo(
|
|
28
|
+
* Ensure.that(list, property('length', equals(2))),
|
|
29
|
+
* )
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* ## Asserting on a list of objects
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
36
|
+
* import { Ensure, property, equals } from '@serenity-js/assertions'
|
|
37
|
+
*
|
|
38
|
+
* const developers = [{
|
|
39
|
+
* name: 'Jan',
|
|
40
|
+
* id: '@jan-molak',
|
|
41
|
+
* }, {
|
|
42
|
+
* name: 'John',
|
|
43
|
+
* id: '@wakaleo',
|
|
44
|
+
* }]
|
|
45
|
+
*
|
|
46
|
+
* await actorCalled('Ester').attemptsTo(
|
|
47
|
+
* Ensure.that(
|
|
48
|
+
* developers,
|
|
49
|
+
* containItemsWhereEachItem(
|
|
50
|
+
* property('id', startsWith('@'))
|
|
51
|
+
* ),
|
|
52
|
+
* ),
|
|
53
|
+
* )
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @param propertyName
|
|
57
|
+
* @param expectation
|
|
58
|
+
*
|
|
59
|
+
* @group Expectations
|
|
60
|
+
*/
|
|
61
|
+
export function property(propertyName, expectation) {
|
|
62
|
+
return new HasProperty(propertyName, expectation);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @package
|
|
66
|
+
*/
|
|
67
|
+
class HasProperty extends Expectation {
|
|
68
|
+
propertyName;
|
|
69
|
+
constructor(propertyName, expectation) {
|
|
70
|
+
const subject = `have property ${String(propertyName)} that does ${expectation}`;
|
|
71
|
+
super('property', subject, async (actor, actual) => {
|
|
72
|
+
const actualValue = await actor.answer(actual);
|
|
73
|
+
const outcome = await actor.answer(expectation.isMetFor(actualValue[propertyName]));
|
|
74
|
+
const expectationDetails = ExpectationDetails.of('property', String(propertyName), outcome.expectation);
|
|
75
|
+
return outcome instanceof ExpectationMet
|
|
76
|
+
? new ExpectationMet(subject, expectationDetails, outcome.expected, outcome.actual)
|
|
77
|
+
: new ExpectationNotMet(subject, expectationDetails, outcome.expected, outcome.actual);
|
|
78
|
+
});
|
|
79
|
+
this.propertyName = propertyName;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property.js","sourceRoot":"","sources":["../../src/expectations/property.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,MAAM,UAAU,QAAQ,CACpB,YAA0B,EAC1B,WAA8C;IAE9C,OAAO,IAAI,WAAW,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,MAAM,WAAsE,SAAQ,WAAmB;IAE9E;IADrB,YACqB,YAA0B,EAC3C,WAA8C;QAE9C,MAAM,OAAO,GAAG,iBAAkB,MAAM,CAAC,YAAY,CAAE,cAAe,WAAY,EAAE,CAAC;QACrF,KAAK,CACD,UAAU,EACV,OAAO,EACP,KAAK,EAAE,KAAuB,EAAE,MAA0B,EAAE,EAAE;YAC1D,MAAM,WAAW,GAAK,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACjD,MAAM,OAAO,GAAS,MAAM,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAE1F,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;YAExG,OAAO,OAAO,YAAY,cAAc;gBACpC,CAAC,CAAC,IAAI,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC;gBACnF,CAAC,CAAC,IAAI,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/F,CAAC,CACJ,CAAC;QAjBe,iBAAY,GAAZ,YAAY,CAAc;IAkB/C,CAAC;CACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Expectation } from '@serenity-js/core';
|
|
2
|
+
/**
|
|
3
|
+
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
|
|
4
|
+
* starts with the resolved value of `expected`.
|
|
5
|
+
*
|
|
6
|
+
* ## Ensuring that a given string starts with an expected substring
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
10
|
+
* import { Ensure, startsWith } from '@serenity-js/assertions'
|
|
11
|
+
*
|
|
12
|
+
* await actorCalled('Ester').attemptsTo(
|
|
13
|
+
* Ensure.that('Hello World!', startsWith('Hello')),
|
|
14
|
+
* )
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param expected
|
|
18
|
+
*
|
|
19
|
+
* @group Expectations
|
|
20
|
+
*/
|
|
21
|
+
export declare const startsWith: (expected: import("@serenity-js/core").Answerable<string>) => Expectation<string>;
|
|
22
|
+
//# sourceMappingURL=startsWith.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startsWith.d.ts","sourceRoot":"","sources":["../../src/expectations/startsWith.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU,mFAItB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Expectation } from '@serenity-js/core';
|
|
2
|
+
/**
|
|
3
|
+
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
|
|
4
|
+
* starts with the resolved value of `expected`.
|
|
5
|
+
*
|
|
6
|
+
* ## Ensuring that a given string starts with an expected substring
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
10
|
+
* import { Ensure, startsWith } from '@serenity-js/assertions'
|
|
11
|
+
*
|
|
12
|
+
* await actorCalled('Ester').attemptsTo(
|
|
13
|
+
* Ensure.that('Hello World!', startsWith('Hello')),
|
|
14
|
+
* )
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param expected
|
|
18
|
+
*
|
|
19
|
+
* @group Expectations
|
|
20
|
+
*/
|
|
21
|
+
export const startsWith = Expectation.define('startsWith', 'start with', (actual, expected) => actual.startsWith(expected));
|
|
22
|
+
//# sourceMappingURL=startsWith.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startsWith.js","sourceRoot":"","sources":["../../src/expectations/startsWith.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CACxC,YAAY,EAAE,YAAY,EAC1B,CAAC,MAAc,EAAE,QAAgB,EAAE,EAAE,CACjC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAClC,CAAA"}
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
|
package/esm/index.js
ADDED
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
|
package/lib/Ensure.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Answerable, AnswersQuestions, CollectsArtifacts, Expectation, RuntimeError, UsesAbilities } from '@serenity-js/core';
|
|
2
2
|
import { Interaction } from '@serenity-js/core';
|
|
3
|
-
import { EnsureEventually } from './EnsureEventually';
|
|
3
|
+
import { EnsureEventually } from './EnsureEventually.js';
|
|
4
4
|
/**
|
|
5
5
|
* The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `Ensure`
|
|
6
6
|
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
|
package/lib/Ensure.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ensure.d.ts","sourceRoot":"","sources":["../src/Ensure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,gBAAgB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3F;;;;;;;;;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,7 +2,7 @@
|
|
|
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
|
|
5
|
+
const EnsureEventually_js_1 = require("./EnsureEventually.js");
|
|
6
6
|
/**
|
|
7
7
|
* The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `Ensure`
|
|
8
8
|
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
|
|
@@ -89,7 +89,7 @@ class Ensure extends core_1.Interaction {
|
|
|
89
89
|
* @returns {Ensure<Actual_Type>}
|
|
90
90
|
*/
|
|
91
91
|
static eventually(actual, expectation) {
|
|
92
|
-
return new
|
|
92
|
+
return new EnsureEventually_js_1.EnsureEventually(actual, expectation, core_1.Activity.callerLocation(5));
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* @param actual
|
package/lib/Ensure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ensure.js","sourceRoot":"","sources":["../src/Ensure.ts"],"names":[],"mappings":";;;AAQA,4CAW2B;AAG3B
|
|
1
|
+
{"version":3,"file":"Ensure.js","sourceRoot":"","sources":["../src/Ensure.ts"],"names":[],"mappings":";;;AAQA,4CAW2B;AAG3B,+DAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAa,MAAe,SAAQ,kBAAW;IAgDpB;IACA;IA/CvB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,CAAc,MAA+B,EAAE,WAAqC;QAC3F,OAA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,MAAM,EAAE;gBAC5D,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EAAE;aACzC,CAAC,CAAC;QACP,CAAC;QAED,IAAI,CAAE,CAAC,OAAO,YAAY,qBAAc,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,iBAAU,CAAC,IAAA,QAAC,EAAA,wFAAyF,OAAQ,EAAE,CAAC,CAAC;QAC/H,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,iBAAiB,CAAC,kBAAwE,EAAE,OAAgB;QACxG,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAE9C,OAAO,kBAAW,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAC,KAAK,EAAC,EAAE;YACpD,IAAI,CAAC;gBACD,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAChC,CAAC;YACD,OAAO,KAAK,EAAE,CAAC;gBACX,MAAM,kBAAW,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE;oBACnD,OAAO,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO;oBACjC,QAAQ;oBACR,KAAK,EAAE,KAAK;iBACf,CAAC,CAAC;YACP,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA3GD,wBA2GC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Answerable, AnswersQuestions, CollectsArtifacts, Expectation, RuntimeError, UsesAbilities } from '@serenity-js/core';
|
|
2
2
|
import { Duration, Interaction } from '@serenity-js/core';
|
|
3
|
-
import type { FileSystemLocation } from '@serenity-js/core/
|
|
3
|
+
import type { FileSystemLocation } from '@serenity-js/core/io';
|
|
4
4
|
/**
|
|
5
5
|
* The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `EnsureEventually`
|
|
6
6
|
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnsureEventually.d.ts","sourceRoot":"","sources":["../src/EnsureEventually.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EAEX,YAAY,EACZ,aAAa,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGH,QAAQ,EAER,WAAW,EAMd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EnsureEventually.d.ts","sourceRoot":"","sources":["../src/EnsureEventually.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EAEX,YAAY,EACZ,aAAa,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGH,QAAQ,EAER,WAAW,EAMd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,qBAAa,gBAAgB,CAAC,MAAM,CAAE,SAAQ,WAAW;IAQjD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7C,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;IAEnD,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ;IAVzC;;;;;OAKG;gBAEoB,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,EAC1B,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EACnD,QAAQ,EAAE,kBAAkB,EACT,OAAO,CAAC,EAAE,QAAQ;IAKzC;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAIzD;;OAEG;IACG,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAsC3F;;;;;;;;;OASG;IACH,iBAAiB,CAAC,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,KAAK,YAAY,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW;CAe7H"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.contain = void 0;
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
|
-
const
|
|
5
|
+
const index_js_1 = require("tiny-types/lib/objects/index.js");
|
|
6
6
|
/**
|
|
7
7
|
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual array of `Item[]` contains
|
|
8
8
|
* at least one `Item` that is equal to the resolved value of `expected`.
|
|
@@ -27,5 +27,5 @@ const objects_1 = require("tiny-types/lib/objects");
|
|
|
27
27
|
*
|
|
28
28
|
* @group Expectations
|
|
29
29
|
*/
|
|
30
|
-
exports.contain = core_1.Expectation.define('contain', 'contain', (actual, expected) => actual.some(item => (0,
|
|
30
|
+
exports.contain = core_1.Expectation.define('contain', 'contain', (actual, expected) => actual.some(item => (0, index_js_1.equal)(item, expected)));
|
|
31
31
|
//# sourceMappingURL=contain.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contain.js","sourceRoot":"","sources":["../../src/expectations/contain.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"contain.js","sourceRoot":"","sources":["../../src/expectations/contain.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,8DAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;;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,gBAAK,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CACjD,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.equals = void 0;
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
|
-
const
|
|
5
|
+
const index_js_1 = require("tiny-types/lib/objects/index.js");
|
|
6
6
|
/**
|
|
7
7
|
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value
|
|
8
8
|
* is equal to the resolved value of `expectedValue`.
|
|
@@ -28,5 +28,5 @@ const objects_1 = require("tiny-types/lib/objects");
|
|
|
28
28
|
*
|
|
29
29
|
* @group Expectations
|
|
30
30
|
*/
|
|
31
|
-
exports.equals = core_1.Expectation.define('equals', 'equal', (actual, expected) => (0,
|
|
31
|
+
exports.equals = core_1.Expectation.define('equals', 'equal', (actual, expected) => (0, index_js_1.equal)(actual, expected));
|
|
32
32
|
//# sourceMappingURL=equals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equals.js","sourceRoot":"","sources":["../../src/expectations/equals.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"equals.js","sourceRoot":"","sources":["../../src/expectations/equals.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,8DAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACU,QAAA,MAAM,GAAG,kBAAW,CAAC,MAAM,CACpC,QAAQ,EAAE,OAAO,EACjB,CAAI,MAAS,EAAE,QAAW,EAAE,EAAE,CAC1B,IAAA,gBAAK,EAAC,MAAM,EAAE,QAAQ,CAAC,CAC9B,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export * from './and';
|
|
2
|
-
export * from './contain';
|
|
3
|
-
export * from './containAtLeastOneItemThat';
|
|
4
|
-
export * from './containItemsWhereEachItem';
|
|
5
|
-
export * from './endsWith';
|
|
6
|
-
export * from './equals';
|
|
7
|
-
export * from './includes';
|
|
8
|
-
export * from './isAfter';
|
|
9
|
-
export * from './isBefore';
|
|
10
|
-
export * from './isCloseTo';
|
|
11
|
-
export * from './isFalse';
|
|
12
|
-
export * from './isGreaterThan';
|
|
13
|
-
export * from './isLessThan';
|
|
14
|
-
export * from './isPresent';
|
|
15
|
-
export * from './isTrue';
|
|
16
|
-
export * from './matches';
|
|
17
|
-
export * from './not';
|
|
18
|
-
export * from './or';
|
|
19
|
-
export * from './property';
|
|
20
|
-
export * from './startsWith';
|
|
1
|
+
export * from './and.js';
|
|
2
|
+
export * from './contain.js';
|
|
3
|
+
export * from './containAtLeastOneItemThat.js';
|
|
4
|
+
export * from './containItemsWhereEachItem.js';
|
|
5
|
+
export * from './endsWith.js';
|
|
6
|
+
export * from './equals.js';
|
|
7
|
+
export * from './includes.js';
|
|
8
|
+
export * from './isAfter.js';
|
|
9
|
+
export * from './isBefore.js';
|
|
10
|
+
export * from './isCloseTo.js';
|
|
11
|
+
export * from './isFalse.js';
|
|
12
|
+
export * from './isGreaterThan.js';
|
|
13
|
+
export * from './isLessThan.js';
|
|
14
|
+
export * from './isPresent.js';
|
|
15
|
+
export * from './isTrue.js';
|
|
16
|
+
export * from './matches.js';
|
|
17
|
+
export * from './not.js';
|
|
18
|
+
export * from './or.js';
|
|
19
|
+
export * from './property.js';
|
|
20
|
+
export * from './startsWith.js';
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expectations/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expectations/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
|
@@ -14,24 +14,24 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./and"), exports);
|
|
18
|
-
__exportStar(require("./contain"), exports);
|
|
19
|
-
__exportStar(require("./containAtLeastOneItemThat"), exports);
|
|
20
|
-
__exportStar(require("./containItemsWhereEachItem"), exports);
|
|
21
|
-
__exportStar(require("./endsWith"), exports);
|
|
22
|
-
__exportStar(require("./equals"), exports);
|
|
23
|
-
__exportStar(require("./includes"), exports);
|
|
24
|
-
__exportStar(require("./isAfter"), exports);
|
|
25
|
-
__exportStar(require("./isBefore"), exports);
|
|
26
|
-
__exportStar(require("./isCloseTo"), exports);
|
|
27
|
-
__exportStar(require("./isFalse"), exports);
|
|
28
|
-
__exportStar(require("./isGreaterThan"), exports);
|
|
29
|
-
__exportStar(require("./isLessThan"), exports);
|
|
30
|
-
__exportStar(require("./isPresent"), exports);
|
|
31
|
-
__exportStar(require("./isTrue"), exports);
|
|
32
|
-
__exportStar(require("./matches"), exports);
|
|
33
|
-
__exportStar(require("./not"), exports);
|
|
34
|
-
__exportStar(require("./or"), exports);
|
|
35
|
-
__exportStar(require("./property"), exports);
|
|
36
|
-
__exportStar(require("./startsWith"), exports);
|
|
17
|
+
__exportStar(require("./and.js"), exports);
|
|
18
|
+
__exportStar(require("./contain.js"), exports);
|
|
19
|
+
__exportStar(require("./containAtLeastOneItemThat.js"), exports);
|
|
20
|
+
__exportStar(require("./containItemsWhereEachItem.js"), exports);
|
|
21
|
+
__exportStar(require("./endsWith.js"), exports);
|
|
22
|
+
__exportStar(require("./equals.js"), exports);
|
|
23
|
+
__exportStar(require("./includes.js"), exports);
|
|
24
|
+
__exportStar(require("./isAfter.js"), exports);
|
|
25
|
+
__exportStar(require("./isBefore.js"), exports);
|
|
26
|
+
__exportStar(require("./isCloseTo.js"), exports);
|
|
27
|
+
__exportStar(require("./isFalse.js"), exports);
|
|
28
|
+
__exportStar(require("./isGreaterThan.js"), exports);
|
|
29
|
+
__exportStar(require("./isLessThan.js"), exports);
|
|
30
|
+
__exportStar(require("./isPresent.js"), exports);
|
|
31
|
+
__exportStar(require("./isTrue.js"), exports);
|
|
32
|
+
__exportStar(require("./matches.js"), exports);
|
|
33
|
+
__exportStar(require("./not.js"), exports);
|
|
34
|
+
__exportStar(require("./or.js"), exports);
|
|
35
|
+
__exportStar(require("./property.js"), exports);
|
|
36
|
+
__exportStar(require("./startsWith.js"), exports);
|
|
37
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expectations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expectations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B;AAC7B,iEAA+C;AAC/C,iEAA+C;AAC/C,gDAA8B;AAC9B,8CAA4B;AAC5B,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B;AAC9B,iDAA+B;AAC/B,+CAA6B;AAC7B,qDAAmC;AACnC,kDAAgC;AAChC,iDAA+B;AAC/B,8CAA4B;AAC5B,+CAA6B;AAC7B,2CAAyB;AACzB,0CAAwB;AACxB,gDAA8B;AAC9B,kDAAgC"}
|
|
@@ -38,5 +38,5 @@ import { Expectation, type Timestamp } from '@serenity-js/core';
|
|
|
38
38
|
*
|
|
39
39
|
* @group Expectations
|
|
40
40
|
*/
|
|
41
|
-
export declare const isAfter: (expected: import("@serenity-js/core").Answerable<
|
|
41
|
+
export declare const isAfter: (expected: import("@serenity-js/core").Answerable<Timestamp | Date>) => Expectation<Timestamp | Date>;
|
|
42
42
|
//# sourceMappingURL=isAfter.d.ts.map
|
|
@@ -38,5 +38,5 @@ import { Expectation, type Timestamp } from '@serenity-js/core';
|
|
|
38
38
|
*
|
|
39
39
|
* @group Expectations
|
|
40
40
|
*/
|
|
41
|
-
export declare const isBefore: (expected: import("@serenity-js/core").Answerable<
|
|
41
|
+
export declare const isBefore: (expected: import("@serenity-js/core").Answerable<Timestamp | Date>) => Expectation<Timestamp | Date>;
|
|
42
42
|
//# sourceMappingURL=isBefore.d.ts.map
|