Socket
Socket
Sign inDemoInstall

@serenity-js/assertions

Package Overview
Dependencies
Maintainers
0
Versions
360
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serenity-js/assertions - npm Package Compare versions

Comparing version 3.25.0 to 3.25.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [3.25.1](https://github.com/serenity-js/serenity-js/compare/v3.25.0...v3.25.1) (2024-07-10)
### Bug Fixes
* **core:** all the API docs now link to the online Serenity/JS API documentation ([f8f451d](https://github.com/serenity-js/serenity-js/commit/f8f451dffdb4caaa2e31a860f59d59470f4856ad))
# [3.25.0](https://github.com/serenity-js/serenity-js/compare/v3.24.1...v3.25.0) (2024-07-03)

@@ -8,0 +19,0 @@

38

lib/Ensure.d.ts

@@ -5,6 +5,6 @@ import type { Answerable, AnswersQuestions, CollectsArtifacts, Expectation, RuntimeError, UsesAbilities } from '@serenity-js/core';

/**
* The {@apilink Interaction|interaction} to `Ensure`
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation}.
* If not, it throws an {@apilink AssertionError}.
* The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `Ensure`
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/).
* If not, it throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
*

@@ -56,12 +56,12 @@ * Use `Ensure` to verify the state of the system under test.

/**
* Creates an {@apilink Interaction|interaction} to `Ensure`, which
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation}.
* If not, it immediately throws an {@apilink AssertionError}.
* Creates an [interaction](https://serenity-js.org/api/core/class/Interaction/) to `Ensure`, which
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/).
* If not, it immediately throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
*
* @param {Answerable<Actual_Type>} actual
* An {@apilink Answerable} describing the actual state of the system.
* An [`Answerable`](https://serenity-js.org/api/core/#Answerable) describing the actual state of the system.
*
* @param {Expectation<Actual_Type>} expectation
* An {@apilink Expectation} you expect the `actual` value to meet
* An [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) you expect the `actual` value to meet
*

@@ -72,15 +72,13 @@ * @returns {Ensure<Actual_Type>}

/**
* Creates an {@apilink Interaction|interaction} to {@apilink EnsureEventually}, which
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation} within the expected timeframe.
* Creates an [interaction](https://serenity-js.org/api/core/class/Interaction/) to [`EnsureEventually`](https://serenity-js.org/api/assertions/class/EnsureEventually/),
* which verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) within the expected timeframe.
*
* If the expectation is not met by the time the timeout expires, the interaction throws an {@apilink AssertionError}.
* `EnsureEventually` ignores retries the evaluation if resolving the `actual` results in an {@apilink OptionalNotPresentError},
* but rethrows any other errors.
* If the expectation is not met by the time the timeout expires, the interaction throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
*
* @param {Answerable<Actual_Type>} actual
* An {@apilink Answerable} describing the actual state of the system.
* An [`Answerable`](https://serenity-js.org/api/core/#Answerable) describing the actual state of the system.
*
* @param {Expectation<Actual_Type>} expectation
* An {@apilink Expectation} you expect the `actual` value to meet
* An [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) you expect the `actual` value to meet
*

@@ -101,7 +99,7 @@ * @returns {Ensure<Actual_Type>}

/**
* Overrides the default {@apilink AssertionError} thrown when
* Overrides the default [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/) thrown when
* the actual value does not meet the expectation.
*
* @param typeOfRuntimeError
* A constructor function producing a subtype of {@apilink RuntimeError} to throw, e.g. {@apilink TestCompromisedError}
* A constructor function producing a subtype of [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/) to throw, e.g. [`TestCompromisedError`](https://serenity-js.org/api/core/class/TestCompromisedError/)
*

@@ -108,0 +106,0 @@ * @param message

@@ -7,6 +7,6 @@ "use strict";

/**
* The {@apilink Interaction|interaction} to `Ensure`
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation}.
* If not, it throws an {@apilink AssertionError}.
* The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `Ensure`
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/).
* If not, it throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
*

@@ -58,12 +58,12 @@ * Use `Ensure` to verify the state of the system under test.

/**
* Creates an {@apilink Interaction|interaction} to `Ensure`, which
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation}.
* If not, it immediately throws an {@apilink AssertionError}.
* Creates an [interaction](https://serenity-js.org/api/core/class/Interaction/) to `Ensure`, which
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/).
* If not, it immediately throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
*
* @param {Answerable<Actual_Type>} actual
* An {@apilink Answerable} describing the actual state of the system.
* An [`Answerable`](https://serenity-js.org/api/core/#Answerable) describing the actual state of the system.
*
* @param {Expectation<Actual_Type>} expectation
* An {@apilink Expectation} you expect the `actual` value to meet
* An [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) you expect the `actual` value to meet
*

@@ -76,15 +76,13 @@ * @returns {Ensure<Actual_Type>}

/**
* Creates an {@apilink Interaction|interaction} to {@apilink EnsureEventually}, which
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation} within the expected timeframe.
* Creates an [interaction](https://serenity-js.org/api/core/class/Interaction/) to [`EnsureEventually`](https://serenity-js.org/api/assertions/class/EnsureEventually/),
* which verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) within the expected timeframe.
*
* If the expectation is not met by the time the timeout expires, the interaction throws an {@apilink AssertionError}.
* `EnsureEventually` ignores retries the evaluation if resolving the `actual` results in an {@apilink OptionalNotPresentError},
* but rethrows any other errors.
* If the expectation is not met by the time the timeout expires, the interaction throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
*
* @param {Answerable<Actual_Type>} actual
* An {@apilink Answerable} describing the actual state of the system.
* An [`Answerable`](https://serenity-js.org/api/core/#Answerable) describing the actual state of the system.
*
* @param {Expectation<Actual_Type>} expectation
* An {@apilink Expectation} you expect the `actual` value to meet
* An [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) you expect the `actual` value to meet
*

@@ -128,7 +126,7 @@ * @returns {Ensure<Actual_Type>}

/**
* Overrides the default {@apilink AssertionError} thrown when
* Overrides the default [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/) thrown when
* the actual value does not meet the expectation.
*
* @param typeOfRuntimeError
* A constructor function producing a subtype of {@apilink RuntimeError} to throw, e.g. {@apilink TestCompromisedError}
* A constructor function producing a subtype of [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/) to throw, e.g. [`TestCompromisedError`](https://serenity-js.org/api/core/class/TestCompromisedError/)
*

@@ -135,0 +133,0 @@ * @param message

@@ -5,12 +5,12 @@ import type { Answerable, AnswersQuestions, CollectsArtifacts, Expectation, RuntimeError, UsesAbilities } from '@serenity-js/core';

/**
* The {@apilink Interaction|interaction} to `EnsureEventually`
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation} within the expected timeframe.
* The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `EnsureEventually`
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) within the expected timeframe.
*
* If the expectation is not met by the time the timeout expires, the interaction throws an {@apilink AssertionError}.
* `EnsureEventually` retries the evaluation if resolving the `actual` results in an {@apilink ListItemNotFoundError},
* If the expectation is not met by the time the timeout expires, the interaction throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
* `EnsureEventually` retries the evaluation if resolving the `actual` results in an [`ListItemNotFoundError`](https://serenity-js.org/api/core/class/ListItemNotFoundError/),
* but rethrows any other errors.
*
* :::tip Use the factory method
* Use the factory method {@apilink Ensure.eventually} to instantiate this interaction.
* Use the factory method [`Ensure.eventually`](https://serenity-js.org/api/assertions/class/Ensure/#eventually] to instantiate this interaction.
* :::

@@ -78,3 +78,3 @@ *

/**
* Override the default timeout set via {@apilink SerenityConfig.interactionTimeout}.
* Override the default timeout set via [`SerenityConfig.interactionTimeout`](https://serenity-js.org/api/core/class/SerenityConfig/#interactionTimeout).
*

@@ -89,7 +89,7 @@ * @param timeout

/**
* Overrides the default {@apilink AssertionError} thrown when
* Overrides the default [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/) thrown when
* the actual value does not meet the expectation.
*
* @param typeOfRuntimeError
* A constructor function producing a subtype of {@apilink RuntimeError} to throw, e.g. {@apilink TestCompromisedError}
* A constructor function producing a subtype of [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/) to throw, e.g. [`TestCompromisedError`](https://serenity-js.org/api/core/class/TestCompromisedError/)
*

@@ -96,0 +96,0 @@ * @param message

@@ -6,12 +6,12 @@ "use strict";

/**
* The {@apilink Interaction|interaction} to `EnsureEventually`
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation} within the expected timeframe.
* The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `EnsureEventually`
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) within the expected timeframe.
*
* If the expectation is not met by the time the timeout expires, the interaction throws an {@apilink AssertionError}.
* `EnsureEventually` retries the evaluation if resolving the `actual` results in an {@apilink ListItemNotFoundError},
* If the expectation is not met by the time the timeout expires, the interaction throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
* `EnsureEventually` retries the evaluation if resolving the `actual` results in an [`ListItemNotFoundError`](https://serenity-js.org/api/core/class/ListItemNotFoundError/),
* but rethrows any other errors.
*
* :::tip Use the factory method
* Use the factory method {@apilink Ensure.eventually} to instantiate this interaction.
* Use the factory method [`Ensure.eventually`](https://serenity-js.org/api/assertions/class/Ensure/#eventually] to instantiate this interaction.
* :::

@@ -84,3 +84,3 @@ *

/**
* Override the default timeout set via {@apilink SerenityConfig.interactionTimeout}.
* Override the default timeout set via [`SerenityConfig.interactionTimeout`](https://serenity-js.org/api/core/class/SerenityConfig/#interactionTimeout).
*

@@ -122,7 +122,7 @@ * @param timeout

/**
* Overrides the default {@apilink AssertionError} thrown when
* Overrides the default [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/) thrown when
* the actual value does not meet the expectation.
*
* @param typeOfRuntimeError
* A constructor function producing a subtype of {@apilink RuntimeError} to throw, e.g. {@apilink TestCompromisedError}
* A constructor function producing a subtype of [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/) to throw, e.g. [`TestCompromisedError`](https://serenity-js.org/api/core/class/TestCompromisedError/)
*

@@ -129,0 +129,0 @@ * @param message

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when all the `expectations` are met for the given actual value.
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when all the `expectations` are met for the given actual value.
*

@@ -5,0 +5,0 @@ * Use `and` to combine several expectations using logical "and",

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when all the `expectations` are met for the given actual value.
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when all the `expectations` are met for the given actual value.
*

@@ -9,0 +9,0 @@ * Use `and` to combine several expectations using logical "and",

import { Expectation } from '@serenity-js/core';
/**
* Produces an {@apilink Expectation|expectation} that is met when the actual array of `Item[]` contains
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual array of `Item[]` contains
* at least one `Item` that is equal to the resolved value of `expected`.

@@ -5,0 +5,0 @@ *

@@ -7,3 +7,3 @@ "use strict";

/**
* Produces an {@apilink Expectation|expectation} that is met when the actual array of `Item[]` contains
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual array of `Item[]` contains
* at least one `Item` that is equal to the resolved value of `expected`.

@@ -10,0 +10,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Produces an {@apilink Expectation|expectation} that is met when the actual array of `Item[]` contains
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual array of `Item[]` contains
* at least one `Item` for which the `expectation` is met.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Produces an {@apilink Expectation|expectation} that is met when the actual array of `Item[]` contains
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual array of `Item[]` contains
* at least one `Item` for which the `expectation` is met.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Produces an {@apilink Expectation|expectation} that is met when all the items of the actual array of `Item[]`
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when all the items of the actual array of `Item[]`
* meet the `expectation`.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Produces an {@apilink Expectation|expectation} that is met when all the items of the actual array of `Item[]`
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when all the items of the actual array of `Item[]`
* meet the `expectation`.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* ends with the resolved value of `expected`.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* ends with the resolved value of `expected`.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Produces an {@apilink Expectation|expectation} that is met when the actual value
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value
* is equal to the resolved value of `expectedValue`.

@@ -5,0 +5,0 @@ *

@@ -7,3 +7,3 @@ "use strict";

/**
* Produces an {@apilink Expectation|expectation} that is met when the actual value
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value
* is equal to the resolved value of `expectedValue`.

@@ -10,0 +10,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* includes a substring of `expected`.

@@ -19,3 +19,3 @@ *

*
* {@apilink Page.url|Page.current().url()} returns a {@apilink QuestionAdapter|`QuestionAdapter<URL>`},
* [`Page.current().url()`](https://serenity-js.org/api/web/class/Page/#url) returns a [`QuestionAdapter<URL>`](https://serenity-js.org/api/core/#QuestionAdapter)
* a proxy object around the standard Node.js [URL](https://nodejs.org/api/url.html) class,

@@ -22,0 +22,0 @@ * offering access to `string` properties such as [`hostname`](https://nodejs.org/api/url.html#urlobjecthostname),

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* includes a substring of `expected`.

@@ -23,3 +23,3 @@ *

*
* {@apilink Page.url|Page.current().url()} returns a {@apilink QuestionAdapter|`QuestionAdapter<URL>`},
* [`Page.current().url()`](https://serenity-js.org/api/web/class/Page/#url) returns a [`QuestionAdapter<URL>`](https://serenity-js.org/api/core/#QuestionAdapter)
* a proxy object around the standard Node.js [URL](https://nodejs.org/api/url.html) class,

@@ -26,0 +26,0 @@ * offering access to `string` properties such as [`hostname`](https://nodejs.org/api/url.html#urlobjecthostname),

import { Expectation, type Timestamp } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `Date`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `Date`
* is after the expected `Date`.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `Date`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `Date`
* is after the expected `Date`.

@@ -9,0 +9,0 @@ *

import { Expectation, type Timestamp } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `Date`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `Date`
* is before the expected `Date`.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `Date`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `Date`
* is before the expected `Date`.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Produces an {@apilink Expectation|expectation} that is met when the actual value
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value
* is within a given ± `absoluteTolerance` range of the `expected` value.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Produces an {@apilink Expectation|expectation} that is met when the actual value
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value
* is within a given ± `absoluteTolerance` range of the `expected` value.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `boolean` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `boolean` value
* is `false`.

@@ -5,0 +5,0 @@ *

@@ -7,3 +7,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `boolean` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `boolean` value
* is `false`.

@@ -10,0 +10,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `number`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `number`
* is greater than the expected `number`.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `number`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `number`
* is greater than the expected `number`.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `number`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `number`
* is less than the expected `number`.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `number`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `number`
* is less than the expected `number`.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the `actual` value is not undefined or null.
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the `actual` value is not undefined or null.
*
* Also, when the `actual` implements {@apilink Optional}, the expectation is met when calling {@apilink Optional.isPresent()}
* returns an {@apilink Answerable} that resolves to `true`
* Also, when the `actual` implements [`Optional`](https://serenity-js.org/api/core/interface/Optional/),
* the expectation is met when calling [`Optional.isPresent`](https://serenity-js.org/api/core/interface/Optional/#isPresent)
* returns an [`Answerable`](https://serenity-js.org/api/core/#Answerable) that resolves to `true`
*

@@ -8,0 +9,0 @@ * ## Ensuring that a value is defined

@@ -6,6 +6,7 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the `actual` value is not undefined or null.
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the `actual` value is not undefined or null.
*
* Also, when the `actual` implements {@apilink Optional}, the expectation is met when calling {@apilink Optional.isPresent()}
* returns an {@apilink Answerable} that resolves to `true`
* Also, when the `actual` implements [`Optional`](https://serenity-js.org/api/core/interface/Optional/),
* the expectation is met when calling [`Optional.isPresent`](https://serenity-js.org/api/core/interface/Optional/#isPresent)
* returns an [`Answerable`](https://serenity-js.org/api/core/#Answerable) that resolves to `true`
*

@@ -12,0 +13,0 @@ * ## Ensuring that a value is defined

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `boolean` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `boolean` value
* is `true`.

@@ -5,0 +5,0 @@ *

@@ -7,3 +7,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `boolean` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `boolean` value
* is `true`.

@@ -10,0 +10,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* matches the `expected` regular expression.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* matches the `expected` regular expression.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Produces an {@apilink Expectation|expectation} that negates the provided `expectation`.
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that negates the provided `expectation`.
*

@@ -5,0 +5,0 @@ * ## Ensuring that the actual value does not equal the expected value

@@ -6,3 +6,3 @@ "use strict";

/**
* Produces an {@apilink Expectation|expectation} that negates the provided `expectation`.
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that negates the provided `expectation`.
*

@@ -9,0 +9,0 @@ * ## Ensuring that the actual value does not equal the expected value

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when at least one of the `expectations` is met for the given actual value.
* 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.
*

@@ -5,0 +5,0 @@ * Use `or` to combine several expectations using logical "or",

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when at least one of the `expectations` is met for the given actual value.
* 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.
*

@@ -9,0 +9,0 @@ * Use `or` to combine several expectations using logical "or",

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the value of
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the value of
* the `actual[propertyName]` meets the `expectation`.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the value of
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the value of
* the `actual[propertyName]` meets the `expectation`.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* starts with the resolved value of `expected`.

@@ -5,0 +5,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* starts with the resolved value of `expected`.

@@ -9,0 +9,0 @@ *

{
"name": "@serenity-js/assertions",
"version": "3.25.0",
"version": "3.25.1",
"description": "Screenplay-style assertion library",

@@ -47,3 +47,3 @@ "author": {

"dependencies": {
"@serenity-js/core": "3.25.0",
"@serenity-js/core": "3.25.1",
"tiny-types": "1.22.0"

@@ -61,3 +61,3 @@ },

},
"gitHead": "22657b685b6002f75b2569db54f4bea31ab91d12"
"gitHead": "450b994115cf9f1a1547ef92ac9387e0c57821ce"
}

@@ -20,3 +20,3 @@ # Serenity/JS

- Find answers to your Serenity/JS questions on the [Serenity/JS Forum](https://github.com/orgs/serenity-js/discussions/categories/how-do-i),
- Learn how to [contribute to Serenity/JS](https://serenity-js.org/contributing),
- Learn how to [contribute to Serenity/JS](https://serenity-js.org/community/contributing/),
- Support the project and gain access to [Serenity/JS Playbooks](https://github.com/serenity-js/playbooks) by becoming a [Serenity/JS GitHub Sponsor](https://github.com/sponsors/serenity-js)!

@@ -23,0 +23,0 @@

@@ -26,6 +26,6 @@ import type {

/**
* The {@apilink Interaction|interaction} to `Ensure`
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation}.
* If not, it throws an {@apilink AssertionError}.
* The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `Ensure`
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/).
* If not, it throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
*

@@ -76,12 +76,12 @@ * Use `Ensure` to verify the state of the system under test.

/**
* Creates an {@apilink Interaction|interaction} to `Ensure`, which
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation}.
* If not, it immediately throws an {@apilink AssertionError}.
* Creates an [interaction](https://serenity-js.org/api/core/class/Interaction/) to `Ensure`, which
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/).
* If not, it immediately throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
*
* @param {Answerable<Actual_Type>} actual
* An {@apilink Answerable} describing the actual state of the system.
* An [`Answerable`](https://serenity-js.org/api/core/#Answerable) describing the actual state of the system.
*
* @param {Expectation<Actual_Type>} expectation
* An {@apilink Expectation} you expect the `actual` value to meet
* An [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) you expect the `actual` value to meet
*

@@ -95,15 +95,13 @@ * @returns {Ensure<Actual_Type>}

/**
* Creates an {@apilink Interaction|interaction} to {@apilink EnsureEventually}, which
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation} within the expected timeframe.
* Creates an [interaction](https://serenity-js.org/api/core/class/Interaction/) to [`EnsureEventually`](https://serenity-js.org/api/assertions/class/EnsureEventually/),
* which verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) within the expected timeframe.
*
* If the expectation is not met by the time the timeout expires, the interaction throws an {@apilink AssertionError}.
* `EnsureEventually` ignores retries the evaluation if resolving the `actual` results in an {@apilink OptionalNotPresentError},
* but rethrows any other errors.
* If the expectation is not met by the time the timeout expires, the interaction throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
*
* @param {Answerable<Actual_Type>} actual
* An {@apilink Answerable} describing the actual state of the system.
* An [`Answerable`](https://serenity-js.org/api/core/#Answerable) describing the actual state of the system.
*
* @param {Expectation<Actual_Type>} expectation
* An {@apilink Expectation} you expect the `actual` value to meet
* An [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) you expect the `actual` value to meet
*

@@ -156,7 +154,7 @@ * @returns {Ensure<Actual_Type>}

/**
* Overrides the default {@apilink AssertionError} thrown when
* Overrides the default [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/) thrown when
* the actual value does not meet the expectation.
*
* @param typeOfRuntimeError
* A constructor function producing a subtype of {@apilink RuntimeError} to throw, e.g. {@apilink TestCompromisedError}
* A constructor function producing a subtype of [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/) to throw, e.g. [`TestCompromisedError`](https://serenity-js.org/api/core/class/TestCompromisedError/)
*

@@ -163,0 +161,0 @@ * @param message

@@ -25,12 +25,12 @@ import type {

/**
* The {@apilink Interaction|interaction} to `EnsureEventually`
* verifies if the resolved value of the provided {@apilink Answerable}
* meets the specified {@apilink Expectation} within the expected timeframe.
* The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `EnsureEventually`
* verifies if the resolved value of the provided [`Answerable`](https://serenity-js.org/api/core/#Answerable)
* meets the specified [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) within the expected timeframe.
*
* If the expectation is not met by the time the timeout expires, the interaction throws an {@apilink AssertionError}.
* `EnsureEventually` retries the evaluation if resolving the `actual` results in an {@apilink ListItemNotFoundError},
* If the expectation is not met by the time the timeout expires, the interaction throws an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/).
* `EnsureEventually` retries the evaluation if resolving the `actual` results in an [`ListItemNotFoundError`](https://serenity-js.org/api/core/class/ListItemNotFoundError/),
* but rethrows any other errors.
*
* :::tip Use the factory method
* Use the factory method {@apilink Ensure.eventually} to instantiate this interaction.
* Use the factory method [`Ensure.eventually`](https://serenity-js.org/api/assertions/class/Ensure/#eventually] to instantiate this interaction.
* :::

@@ -103,3 +103,3 @@ *

/**
* Override the default timeout set via {@apilink SerenityConfig.interactionTimeout}.
* Override the default timeout set via [`SerenityConfig.interactionTimeout`](https://serenity-js.org/api/core/class/SerenityConfig/#interactionTimeout).
*

@@ -154,7 +154,7 @@ * @param timeout

/**
* Overrides the default {@apilink AssertionError} thrown when
* Overrides the default [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/) thrown when
* the actual value does not meet the expectation.
*
* @param typeOfRuntimeError
* A constructor function producing a subtype of {@apilink RuntimeError} to throw, e.g. {@apilink TestCompromisedError}
* A constructor function producing a subtype of [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/) to throw, e.g. [`TestCompromisedError`](https://serenity-js.org/api/core/class/TestCompromisedError/)
*

@@ -161,0 +161,0 @@ * @param message

@@ -5,3 +5,3 @@ import type { Answerable, AnswersQuestions, ExpectationOutcome } from '@serenity-js/core';

/**
* Creates an {@apilink Expectation|expectation} that is met when all the `expectations` are met for the given actual value.
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when all the `expectations` are met for the given actual value.
*

@@ -8,0 +8,0 @@ * Use `and` to combine several expectations using logical "and",

@@ -5,3 +5,3 @@ import { Expectation } from '@serenity-js/core';

/**
* Produces an {@apilink Expectation|expectation} that is met when the actual array of `Item[]` contains
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual array of `Item[]` contains
* at least one `Item` that is equal to the resolved value of `expected`.

@@ -8,0 +8,0 @@ *

@@ -5,3 +5,3 @@ import type { Answerable, AnswersQuestions, ExpectationOutcome} from '@serenity-js/core';

/**
* Produces an {@apilink Expectation|expectation} that is met when the actual array of `Item[]` contains
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual array of `Item[]` contains
* at least one `Item` for which the `expectation` is met.

@@ -8,0 +8,0 @@ *

@@ -5,3 +5,3 @@ import type { Answerable, AnswersQuestions, ExpectationOutcome} from '@serenity-js/core';

/**
* Produces an {@apilink Expectation|expectation} that is met when all the items of the actual array of `Item[]`
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when all the items of the actual array of `Item[]`
* meet the `expectation`.

@@ -8,0 +8,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* ends with the resolved value of `expected`.

@@ -6,0 +6,0 @@ *

@@ -5,3 +5,3 @@ import { Expectation } from '@serenity-js/core';

/**
* Produces an {@apilink Expectation|expectation} that is met when the actual value
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value
* is equal to the resolved value of `expectedValue`.

@@ -8,0 +8,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* includes a substring of `expected`.

@@ -20,3 +20,3 @@ *

*
* {@apilink Page.url|Page.current().url()} returns a {@apilink QuestionAdapter|`QuestionAdapter<URL>`},
* [`Page.current().url()`](https://serenity-js.org/api/web/class/Page/#url) returns a [`QuestionAdapter<URL>`](https://serenity-js.org/api/core/#QuestionAdapter)
* a proxy object around the standard Node.js [URL](https://nodejs.org/api/url.html) class,

@@ -23,0 +23,0 @@ * offering access to `string` properties such as [`hostname`](https://nodejs.org/api/url.html#urlobjecthostname),

import { Expectation, type Timestamp } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `Date`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `Date`
* is after the expected `Date`.

@@ -6,0 +6,0 @@ *

import { Expectation, type Timestamp } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `Date`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `Date`
* is before the expected `Date`.

@@ -6,0 +6,0 @@ *

import { d, Expectation } from '@serenity-js/core';
/**
* Produces an {@apilink Expectation|expectation} that is met when the actual value
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value
* is within a given ± `absoluteTolerance` range of the `expected` value.

@@ -6,0 +6,0 @@ *

@@ -6,3 +6,3 @@ import { Expectation } from '@serenity-js/core';

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `boolean` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `boolean` value
* is `false`.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `number`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `number`
* is greater than the expected `number`.

@@ -6,0 +6,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual value of type `number`
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value of type `number`
* is less than the expected `number`.

@@ -6,0 +6,0 @@ *

@@ -5,6 +5,7 @@ import type { Answerable, AnswersQuestions, Optional } from '@serenity-js/core';

/**
* Creates an {@apilink Expectation|expectation} that is met when the `actual` value is not undefined or null.
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the `actual` value is not undefined or null.
*
* Also, when the `actual` implements {@apilink Optional}, the expectation is met when calling {@apilink Optional.isPresent()}
* returns an {@apilink Answerable} that resolves to `true`
* Also, when the `actual` implements [`Optional`](https://serenity-js.org/api/core/interface/Optional/),
* the expectation is met when calling [`Optional.isPresent`](https://serenity-js.org/api/core/interface/Optional/#isPresent)
* returns an [`Answerable`](https://serenity-js.org/api/core/#Answerable) that resolves to `true`
*

@@ -11,0 +12,0 @@ * ## Ensuring that a value is defined

@@ -6,3 +6,3 @@ import { Expectation } from '@serenity-js/core';

/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `boolean` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `boolean` value
* is `true`.

@@ -9,0 +9,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* matches the `expected` regular expression.

@@ -6,0 +6,0 @@ *

@@ -5,3 +5,3 @@ import type { Answerable, AnswersQuestions} from '@serenity-js/core';

/**
* Produces an {@apilink Expectation|expectation} that negates the provided `expectation`.
* Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that negates the provided `expectation`.
*

@@ -8,0 +8,0 @@ * ## Ensuring that the actual value does not equal the expected value

@@ -5,3 +5,3 @@ import type { Answerable, AnswersQuestions, ExpectationOutcome} from '@serenity-js/core';

/**
* Creates an {@apilink Expectation|expectation} that is met when at least one of the `expectations` is met for the given actual value.
* 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.
*

@@ -8,0 +8,0 @@ * Use `or` to combine several expectations using logical "or",

@@ -5,3 +5,3 @@ import type { Answerable, AnswersQuestions} from '@serenity-js/core';

/**
* Creates an {@apilink Expectation|expectation} that is met when the value of
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the value of
* the `actual[propertyName]` meets the `expectation`.

@@ -8,0 +8,0 @@ *

import { Expectation } from '@serenity-js/core';
/**
* Creates an {@apilink Expectation|expectation} that is met when the actual `string` value
* Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `string` value
* starts with the resolved value of `expected`.

@@ -6,0 +6,0 @@ *

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc