Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@serenity-js/assertions

serenity-js64.4kApache-2.03.31.15TypeScript support: included

Serenity/JS universal assertion library supporting all types of functional tests, including both web and REST API scenarios

automation, integration, serenity, serenity-js, screenplay, screenplay-pattern, tdd, bdd, test, testing

readme

Serenity/JS

NPM Version Downloads FOSSA Status CodeFactor Contributors GitHub stars

Build Status Coverage Status Known Vulnerabilities Libraries.io dependency status for latest release, scoped npm package semantic-release

Serenity/JS on GitHub Serenity/JS on StackOverflow Contribute with Gitpod

Follow Serenity/JS on LinkedIn Watch Serenity/JS on YouTube Join Serenity/JS Community Chat Support Serenity/JS on GitHub

Serenity/JS is an innovative framework designed to make acceptance and regression testing of complex software systems faster, more collaborative and easier to scale.

To get started, check out the comprehensive Serenity/JS Handbook, API documentation, and Serenity/JS project templates on GitHub.

If you have any questions or just want to say hello, join the Serenity/JS Community Chat.

Stay up to date

New tutorials and videos are coming soon, follow Serenity/JS on LinkedIn and subscribe to Serenity/JS YouTube channel to get notified when they're available!

Your feedback matters!

Do you find Serenity/JS useful? Give it a ⭐ star on GitHub!

GitHub stars

Found a bug? Need a feature? Raise an issue or submit a pull request.

Have feedback? Let me know on LinkedIn or leave a comment in Serenity/JS discussions on GitHub

If you'd like to chat with fellow users of Serenity/JS, join us on Serenity/JS Community Chat.

Support Serenity/JS

Serenity/JS is a free open-source framework, so we rely on our wonderful GitHub sponsors to keep the lights on.

If you appreciate all the effort that goes into making sophisticated tools easy to work with, please support our work and become a Serenity/JS GitHub Sponsor today!

GitHub Sponsors

For corporate sponsorship or commercial support, please contact Jan Molak.

License

The Serenity/JS code base is licensed under the Apache-2.0 license, while its documentation and the Serenity/JS Handbook are licensed under the Creative Commons BY-NC-SA 4.0 International. Learn more.

FOSSA Status


- Copyright © 2016- Jan Molak and the Serenity Team


Serenity/JS is available as part of your Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

3.31.15 (2025-05-06)

Note: Version bump only for package @serenity-js/assertions

3.31.14 (2025-04-28)

Bug Fixes

  • deps: update dependency typescript to v5.8.3 (b19c09b)

3.31.13 (2025-03-20)

Note: Version bump only for package @serenity-js/assertions

3.31.12 (2025-03-12)

Note: Version bump only for package @serenity-js/assertions

3.31.10 (2025-03-05)

Bug Fixes

  • deps: update dependency typescript to v5.8.2 (228c7fd)

3.31.9 (2025-02-20)

Note: Version bump only for package @serenity-js/assertions

3.31.8 (2025-02-04)

Note: Version bump only for package @serenity-js/assertions

3.31.7 (2025-01-24)

Note: Version bump only for package @serenity-js/assertions

3.31.6 (2025-01-16)

Note: Version bump only for package @serenity-js/assertions

3.31.5 (2025-01-11)

Bug Fixes

  • deps: update dependency typescript to v5.7.3 (cd87dd8)

3.31.4 (2025-01-01)

Note: Version bump only for package @serenity-js/assertions

3.31.3 (2025-01-01)

Bug Fixes

3.31.2 (2024-12-26)

Note: Version bump only for package @serenity-js/assertions

3.31.1 (2024-12-17)

Note: Version bump only for package @serenity-js/assertions

3.31.0 (2024-12-12)

Note: Version bump only for package @serenity-js/assertions

3.30.0 (2024-11-19)

Note: Version bump only for package @serenity-js/assertions

3.29.5 (2024-11-03)

Note: Version bump only for package @serenity-js/assertions

3.29.4 (2024-10-08)

Note: Version bump only for package @serenity-js/assertions

3.29.3 (2024-10-08)

Note: Version bump only for package @serenity-js/assertions

3.29.2 (2024-09-25)

Note: Version bump only for package @serenity-js/assertions

3.29.1 (2024-09-24)

Note: Version bump only for package @serenity-js/assertions

3.29.0 (2024-09-24)

Note: Version bump only for package @serenity-js/assertions

3.28.0 (2024-09-11)

Note: Version bump only for package @serenity-js/assertions

3.27.0 (2024-09-06)

Bug Fixes

  • core: updated npm tags to improve discoverability (432d331)

Features

  • core: added support for Node 22, dropped support for Node 16 (d5dea01), closes #2518

3.26.1 (2024-09-03)

Note: Version bump only for package @serenity-js/assertions

3.26.0 (2024-08-27)

Note: Version bump only for package @serenity-js/assertions

3.25.5 (2024-08-18)

Bug Fixes

  • deps: update dependency tiny-types to v1.23.0 (1c9a897)

3.25.4 (2024-08-07)

Note: Version bump only for package @serenity-js/assertions

3.25.3 (2024-07-25)

Note: Version bump only for package @serenity-js/assertions

3.25.2 (2024-07-17)

Note: Version bump only for package @serenity-js/assertions

3.25.1 (2024-07-10)

Bug Fixes

  • core: all the API docs now link to the online Serenity/JS API documentation (f8f451d)

3.25.0 (2024-07-03)

Note: Version bump only for package @serenity-js/assertions

3.24.1 (2024-06-26)

Note: Version bump only for package @serenity-js/assertions

3.24.0 (2024-06-18)

Features

  • assertions: dynamic descriptions for assertions and expectations (3fdc7c8), closes #2223

3.23.2 (2024-05-24)

Note: Version bump only for package @serenity-js/assertions

3.23.1 (2024-05-20)

Note: Version bump only for package @serenity-js/assertions

3.23.0 (2024-05-12)

Note: Version bump only for package @serenity-js/assertions

3.22.4 (2024-05-07)

Note: Version bump only for package @serenity-js/assertions

3.22.3 (2024-05-01)

Note: Version bump only for package @serenity-js/assertions

3.22.2 (2024-04-20)

Note: Version bump only for package @serenity-js/assertions

3.22.1 (2024-04-17)

Note: Version bump only for package @serenity-js/assertions

3.22.0 (2024-04-11)

Note: Version bump only for package @serenity-js/assertions

3.21.2 (2024-03-31)

Note: Version bump only for package @serenity-js/assertions

3.21.1 (2024-03-16)

Bug Fixes

  • core: upgraded dependency on tiny-types to 1.22.0 (2c0bb2a)

3.21.0 (2024-03-04)

Note: Version bump only for package @serenity-js/assertions

3.20.0 (2024-03-02)

Note: Version bump only for package @serenity-js/assertions

3.19.0 (2024-03-01)

Note: Version bump only for package @serenity-js/assertions

3.18.1 (2024-02-23)

Note: Version bump only for package @serenity-js/assertions

3.18.0 (2024-02-17)

Note: Version bump only for package @serenity-js/assertions

3.17.0 (2024-02-10)

Note: Version bump only for package @serenity-js/assertions

3.16.2 (2024-02-05)

Note: Version bump only for package @serenity-js/assertions

3.16.1 (2024-02-03)

Bug Fixes

  • core: build with TypeScript 5.2 (2f261ee)

3.16.0 (2024-02-01)

Note: Version bump only for package @serenity-js/assertions

3.15.1 (2024-01-19)

Note: Version bump only for package @serenity-js/assertions

3.15.0 (2024-01-12)

Note: Version bump only for package @serenity-js/assertions

3.14.2 (2023-12-12)

Note: Version bump only for package @serenity-js/assertions

3.14.1 (2023-12-10)

Bug Fixes

  • core: added provenance statements (04c2d87)
  • core: pinned all the direct dependencies (498b336)

3.14.0 (2023-12-02)

Note: Version bump only for package @serenity-js/assertions

3.13.3 (2023-11-22)

Note: Version bump only for package @serenity-js/assertions

3.13.2 (2023-11-14)

Note: Version bump only for package @serenity-js/assertions

3.13.1 (2023-11-07)

Bug Fixes

  • deps: update dependency tiny-types to ^1.21.0 (d4921f9)

3.13.0 (2023-10-19)

Note: Version bump only for package @serenity-js/assertions

3.12.0 (2023-10-09)

Note: Version bump only for package @serenity-js/assertions

3.11.1 (2023-10-04)

Note: Version bump only for package @serenity-js/assertions

3.11.0 (2023-10-03)

Features

  • assertions: isBefore and isAfter accept Timestamp as well as Date objects (55e13d0)

3.10.4 (2023-09-22)

Note: Version bump only for package @serenity-js/assertions

3.10.3 (2023-09-15)

Note: Version bump only for package @serenity-js/assertions

3.10.2 (2023-09-10)

Bug Fixes

  • core: updated installation instruction in the README (ec3f277), closes #1915

3.10.1 (2023-09-01)

Note: Version bump only for package @serenity-js/assertions

3.10.0 (2023-08-23)

Note: Version bump only for package @serenity-js/assertions

3.9.1 (2023-08-18)

Note: Version bump only for package @serenity-js/assertions

3.9.0 (2023-08-04)

Note: Version bump only for package @serenity-js/assertions

3.8.0 (2023-08-01)

Note: Version bump only for package @serenity-js/assertions

3.7.2 (2023-07-26)

Note: Version bump only for package @serenity-js/assertions

3.7.1 (2023-07-22)

Note: Version bump only for package @serenity-js/assertions

3.7.0 (2023-07-20)

Note: Version bump only for package @serenity-js/assertions

3.6.1 (2023-07-11)

Note: Version bump only for package @serenity-js/assertions

3.6.0 (2023-07-11)

Bug Fixes

  • deps: update dependency tiny-types to ^1.20.0 (6d7bf43)

3.5.0 (2023-07-02)

Bug Fixes

  • core: code clean-up: use type-only TypeScript imports where possible (aa49150)

3.4.2 (2023-06-30)

Note: Version bump only for package @serenity-js/assertions

3.4.1 (2023-06-23)

Note: Version bump only for package @serenity-js/assertions

3.4.0 (2023-06-10)

Note: Version bump only for package @serenity-js/assertions

3.3.1 (2023-06-08)

Note: Version bump only for package @serenity-js/assertions

3.3.0 (2023-06-01)

Note: Version bump only for package @serenity-js/assertions

3.2.1 (2023-05-15)

Note: Version bump only for package @serenity-js/assertions

3.2.0 (2023-05-05)

Bug Fixes

  • core: use "types" instead of "typings" in package.json files (b83d922), closes #1682

Features

  • core: introduced support for Node.js 20, dropped support for Node.js 14 (491fef8), closes #1678

3.1.6 (2023-04-18)

Bug Fixes

  • webdriverio: upgraded to TypeScript 5 and WebdriverIO 7.31.1 (15b1ba7), closes #1558 #1651

3.1.5 (2023-04-18)

Note: Version bump only for package @serenity-js/assertions

3.1.3 (2023-04-14)

Note: Version bump only for package @serenity-js/assertions

3.1.2 (2023-04-07)

Note: Version bump only for package @serenity-js/assertions

3.1.1 (2023-04-05)

Note: Version bump only for package @serenity-js/assertions

3.1.0 (2023-04-02)

Note: Version bump only for package @serenity-js/assertions

3.0.1 (2023-03-25)

Note: Version bump only for package @serenity-js/assertions

3.0.0 (2023-03-23)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.45 (2023-03-22)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.44 (2023-03-19)

Bug Fixes

  • core: support for NPM 9 (0493474)
  • deps: update dependency tiny-types to ^1.19.1 (ce335eb)

Features

  • assertions: fault-tolerant interaction to Ensure.eventually (d6297f7), closes #1522
  • core: introduced a new ability ScheduleWork to enable #1083 and #1522 (b275d18)

3.0.0-rc.43 (2023-03-10)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.42 (2023-02-12)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.41 (2023-02-07)

Bug Fixes

  • assertions: custom errors thrown via Ensure now include activity location (1fdf7a2), closes #1102
  • assertions: interaction to Ensure no longer emits an AssertionReport artifact (db3e5ae), closes #1486
  • core: further improvements to how the expected vs received values are rendered in VS Code (e2101d0), closes #1486
  • core: introduced ExpectationDetails to provide more accurate info re failed expectations (02b8f33), closes #1102

Features

  • core: assertion and synchronisation errors include location of the activity that threw them (f06f378), closes #1102
  • core: assertion errors include precise information about unmet expectations and improved diffs (1eb09b1), closes #1102
  • core: better assertion errors reporting in Visual Studio Code (3b94b7d), closes #1486
  • core: new ability to RaiseErrors (4617d39), closes #1102

3.0.0-rc.40 (2023-01-06)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.39 (2023-01-05)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.38 (2022-12-28)

Bug Fixes

  • assertions: improved AssertionError messages (958ab7f)

3.0.0-rc.37 (2022-12-18)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.36 (2022-11-28)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.35 (2022-11-25)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.34 (2022-11-21)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.33 (2022-11-07)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.32 (2022-10-12)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.31 (2022-10-07)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.30 (2022-10-05)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.29 (2022-10-01)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.28 (2022-09-30)

Bug Fixes

  • core: activity is now able to detect invocation location on Node 14 (41f4776), closes #1240

Features

  • assertions: new assertion about a property of an object (9cc03d5)
  • playwright-test: improved Playwright Test reports (6c6b537), closes #1240

3.0.0-rc.27 (2022-08-26)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.26 (2022-08-15)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.25 (2022-08-15)

Bug Fixes

  • core: extracted common TypeScript configuration (0108370)
  • deps: updated TinyTypes to 1.19.0 (f6d53e4)

3.0.0-rc.24 (2022-07-23)

Note: Version bump only for package @serenity-js/assertions

3.0.0-rc.23 (2022-07-19)

Bug Fixes

3.0.0-rc.22 (2022-07-15)

Features

  • assertions: isCloseTo(expected, tolerance) (bb0e935)

3.0.0-rc.21 (2022-07-11)

3.0.0-rc.20 (2022-07-11)

Features

  • core: interactions to Wait.for and Wait.until are now browser-independent (d115142), closes #1035 #1236

3.0.0-rc.19 (2022-06-11)

3.0.0-rc.18 (2022-06-06)

Bug Fixes

  • deps: updated tiny-types (f1951cf)
  • deps: updated tiny-types to 1.18.2 (83a651c)

3.0.0-rc.17 (2022-06-02)

3.0.0-rc.16 (2022-04-15)

3.0.0-rc.15 (2022-04-10)

3.0.0-rc.14 (2022-03-28)

3.0.0-rc.13 (2022-03-02)

3.0.0-rc.12 (2022-02-23)

3.0.0-rc.11 (2022-02-13)

3.0.0-rc.10 (2022-02-03)

3.0.0-rc.9 (2022-02-01)

3.0.0-rc.8 (2022-01-28)

3.0.0-rc.7 (2022-01-28)

Features

  • assertions: isPresent works with any Optional (cea75dc), closes #1103
  • core: replaced Adapter with QuestionAdapter and introduced Optional (8d84ad3), closes #1103
  • core: support for Optional chaining, expectation isPresent, refactored Expectations (1841ee5), closes #1099 #1099 #1103

3.0.0-rc.6 (2022-01-10)

3.0.0-rc.5 (2022-01-07)

3.0.0-rc.4 (2021-12-30)

3.0.0-rc.3 (2021-12-29)

Bug Fixes

  • deps: updated tiny-types to 1.17.0 (3187051)

3.0.0-rc.2 (2021-12-09)

3.0.0-rc.1 (2021-12-09)

3.0.0-rc.0 (2021-12-08)

Bug Fixes

BREAKING CHANGES

  • core: Introduced @serenity-js/web - a shared library for Serenity/JS Web integration modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.