@serenity-js/assertions
Advanced tools
Comparing version 3.23.2 to 3.24.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [3.24.0](https://github.com/serenity-js/serenity-js/compare/v3.23.2...v3.24.0) (2024-06-18) | ||
### Features | ||
* **assertions:** dynamic descriptions for assertions and expectations ([3fdc7c8](https://github.com/serenity-js/serenity-js/commit/3fdc7c83880d58f509c8b9e9e2494167a99444f0)), closes [#2223](https://github.com/serenity-js/serenity-js/issues/2223) | ||
## [3.23.2](https://github.com/serenity-js/serenity-js/compare/v3.23.1...v3.23.2) (2024-05-24) | ||
@@ -8,0 +19,0 @@ |
@@ -99,3 +99,3 @@ "use strict"; | ||
constructor(actual, expectation, location) { | ||
super((0, core_1.d) `#actor ensures that ${actual} does ${expectation}`, location); | ||
super((0, core_1.the) `#actor ensures that ${actual} does ${expectation}`, location); | ||
this.actual = actual; | ||
@@ -110,3 +110,5 @@ this.expectation = expectation; | ||
if (outcome instanceof core_1.ExpectationNotMet) { | ||
const actualDescription = (0, core_1.d) `${this.actual}`; | ||
const actualDescription = this.actual === undefined | ||
? 'undefined' | ||
: core_1.Question.formattedValue().of(this.actual); | ||
const message = `Expected ${actualDescription} to ${outcome.message}`; | ||
@@ -113,0 +115,0 @@ throw core_1.RaiseErrors.as(actor).create(core_1.AssertionError, { |
@@ -77,3 +77,3 @@ "use strict"; | ||
constructor(actual, expectation, location, timeout) { | ||
super((0, core_1.d) `#actor ensures that ${actual} does eventually ${expectation}`, location); | ||
super((0, core_1.the) `#actor ensures that ${actual} does eventually ${expectation}`, location); | ||
this.actual = actual; | ||
@@ -80,0 +80,0 @@ this.expectation = expectation; |
{ | ||
"name": "@serenity-js/assertions", | ||
"version": "3.23.2", | ||
"version": "3.24.0", | ||
"description": "Screenplay-style assertion library", | ||
@@ -47,3 +47,3 @@ "author": { | ||
"dependencies": { | ||
"@serenity-js/core": "3.23.2", | ||
"@serenity-js/core": "3.24.0", | ||
"tiny-types": "1.22.0" | ||
@@ -55,3 +55,3 @@ }, | ||
"@types/mocha": "10.0.6", | ||
"c8": "9.1.0", | ||
"c8": "10.1.2", | ||
"mocha": "10.4.0", | ||
@@ -62,3 +62,3 @@ "mocha-multi": "1.1.7", | ||
}, | ||
"gitHead": "155af39040e128f5657ed3011bfa785d0af0b878" | ||
"gitHead": "174876f2ab2b96bce79ac825ba8c784beae2f63c" | ||
} |
@@ -7,7 +7,7 @@ import type { | ||
RuntimeError, | ||
UsesAbilities} from '@serenity-js/core'; | ||
UsesAbilities | ||
} from '@serenity-js/core'; | ||
import { | ||
Activity, | ||
AssertionError, | ||
d, | ||
ExpectationMet, | ||
@@ -18,3 +18,5 @@ ExpectationNotMet, | ||
LogicError, | ||
RaiseErrors | ||
Question, | ||
RaiseErrors, | ||
the | ||
} from '@serenity-js/core'; | ||
@@ -123,3 +125,3 @@ import type { FileSystemLocation } from '@serenity-js/core/lib/io'; | ||
) { | ||
super(d`#actor ensures that ${ actual } does ${ expectation }`, location); | ||
super(the`#actor ensures that ${ actual } does ${ expectation }`, location); | ||
} | ||
@@ -134,3 +136,6 @@ | ||
if (outcome instanceof ExpectationNotMet) { | ||
const actualDescription = d`${ this.actual }`; | ||
const actualDescription = this.actual === undefined | ||
? 'undefined' | ||
: Question.formattedValue().of(this.actual); | ||
const message = `Expected ${ actualDescription } to ${ outcome.message }`; | ||
@@ -137,0 +142,0 @@ |
@@ -8,3 +8,4 @@ import type { | ||
RuntimeError, | ||
UsesAbilities} from '@serenity-js/core'; | ||
UsesAbilities | ||
} from '@serenity-js/core'; | ||
import { | ||
@@ -19,2 +20,3 @@ AssertionError, | ||
ScheduleWork, | ||
the, | ||
TimeoutExpiredError | ||
@@ -98,3 +100,3 @@ } from '@serenity-js/core'; | ||
) { | ||
super(d`#actor ensures that ${ actual } does eventually ${ expectation }`, location); | ||
super(the`#actor ensures that ${ actual } does eventually ${ expectation }`, location); | ||
} | ||
@@ -101,0 +103,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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
193743
3436
+ Added@serenity-js/core@3.24.0(transitive)
- Removed@serenity-js/core@3.23.2(transitive)
Updated@serenity-js/core@3.24.0