Socket
Socket
Sign inDemoInstall

@serenity-js/assertions

Package Overview
Dependencies
Maintainers
1
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.10.1 to 3.10.2

11

CHANGELOG.md

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

## [3.10.2](https://github.com/serenity-js/serenity-js/compare/v3.10.1...v3.10.2) (2023-09-10)
### Bug Fixes
* **core:** updated installation instruction in the README ([ec3f277](https://github.com/serenity-js/serenity-js/commit/ec3f2778334abbd7324497ceaa2df9f0560a103e)), closes [#1915](https://github.com/serenity-js/serenity-js/issues/1915)
## [3.10.1](https://github.com/serenity-js/serenity-js/compare/v3.10.0...v3.10.1) (2023-09-01)

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

8

package.json
{
"name": "@serenity-js/assertions",
"version": "3.10.1",
"version": "3.10.2",
"description": "Screenplay-style assertion library",

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

"dependencies": {
"@serenity-js/core": "3.10.1",
"@serenity-js/core": "3.10.2",
"tiny-types": "^1.20.0"

@@ -52,3 +52,3 @@ },

"@integration/testing-tools": "3.0.0",
"@types/chai": "^4.3.5",
"@types/chai": "^4.3.6",
"@types/mocha": "^10.0.1",

@@ -61,3 +61,3 @@ "c8": "8.0.1",

},
"gitHead": "7ab90f30b17ed745cad713363a27edfd7cdce08a"
"gitHead": "6834827fffe5dd8dd3d2f39d2fea2c4039ab1d3d"
}

@@ -12,5 +12,6 @@ # Serenity/JS

⭐️ Get started with Serenity/JS!
- [Serenity/JS Handbook](https://serenity-js.org/handbook) and [tutorial](https://serenity-js.org/handbook/web-testing/your-first-web-scenario),
- [API documentation](https://serenity-js.org/api/core),
- [Serenity/JS project templates on GitHub](https://serenity-js.org/handbook/getting-started#serenityjs-project-templates).
- [Serenity/JS web testing tutorial](https://serenity-js.org/handbook/web-testing/your-first-web-scenario)
- [Serenity/JS Handbook](https://serenity-js.org/handbook) and [Getting Started guides](https://serenity-js.org/handbook/getting-started/)
- [API documentation](https://serenity-js.org/api/core)
- [Serenity/JS Project Templates on GitHub](https://serenity-js.org/handbook/getting-started#serenityjs-project-templates)

@@ -30,12 +31,15 @@ 👋 Join the Serenity/JS Community!

To install this module, run the following command in your computer terminal:
```console
npm install --save-dev @serenity-js/{core,assertions}
```sh
npm install --save-dev @serenity-js/core @serenity-js/assertions
```
To learn more about Serenity/JS and how to use it on your project, follow the [Serenity/JS Getting Started guide](https://serenity-js.org/handbook/getting-started/).
### Performing verifications using `Ensure`
```typescript
import { Ensure, endsWith } from '@serenity-js/assertions';
import { actorCalled } from '@serenity-js/core';
import { Navigate, Page } from '@serenity-js/web';
import { Ensure, endsWith } from '@serenity-js/assertions'
import { actorCalled } from '@serenity-js/core'
import { Navigate, Page } from '@serenity-js/web'

@@ -48,3 +52,3 @@ await actorCalled('Erica').attemptsTo(

),
);
)
```

@@ -55,5 +59,5 @@

```typescript
import { actorCalled } from '@serenity-js/core';
import { Check } from '@serenity-js/assertions';
import { Click, isVisible } from '@serenity-js/protractor';
import { actorCalled } from '@serenity-js/core'
import { Check } from '@serenity-js/assertions'
import { Click, isVisible } from '@serenity-js/protractor'

@@ -63,3 +67,3 @@ await actorCalled('Erica').attemptsTo(

.andIfSo(Click.on(CloseModalButton)),
);
)
```

@@ -70,4 +74,4 @@

```typescript
import { actorCalled } from '@serenity-js/core';
import { Click, isVisible, Wait } from '@serenity-js/protractor';
import { actorCalled } from '@serenity-js/core'
import { Click, isVisible, Wait } from '@serenity-js/protractor'

@@ -77,3 +81,3 @@ await actorCalled('Erica').attemptsTo(

Click.on(CloseModalButton)
);
)
```

@@ -84,8 +88,8 @@

```typescript
import { actorCalled } from '@serenity-js/core';
import { Expectation, Ensure } from '@serenity-js/assertions';
import { actorCalled } from '@serenity-js/core'
import { Expectation, Ensure } from '@serenity-js/assertions'
function isDivisibleBy(expected: Answerable<number>): Expectation<number> {
return Expectation.thatActualShould<number, number>('have value divisible by', expected)
.soThat((actualValue, expectedValue) => actualValue % expectedValue === 0);
.soThat((actualValue, expectedValue) => actualValue % expectedValue === 0)
}

@@ -95,3 +99,3 @@

Ensure.that(4, isDivisibleBy(2)),
);
)
```

@@ -102,4 +106,4 @@

```typescript
import { actorCalled } from '@serenity-js/core';
import { Expectation, Ensure, and, or, isGreaterThan, isLessThan, equals } from '@serenity-js/assertions';
import { actorCalled } from '@serenity-js/core'
import { Expectation, Ensure, and, or, isGreaterThan, isLessThan, equals } from '@serenity-js/assertions'

@@ -112,3 +116,3 @@ function isWithin(lowerBound: number, upperBound: number) {

or(isLessThan(upperBound), equals(upperBound)),
));
))
}

@@ -118,3 +122,3 @@

Ensure.that(5, isWithin(3, 6)),
);
)
```

@@ -121,0 +125,0 @@

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