@serenity-js/assertions 3.1.5 → 3.2.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 CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.2.0](https://github.com/serenity-js/serenity-js/compare/v3.1.6...v3.2.0) (2023-05-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **core:** use "types" instead of "typings" in package.json files ([b83d922](https://github.com/serenity-js/serenity-js/commit/b83d922076242c6cd5d6f2da055a05aa5e77f11b)), closes [#1682](https://github.com/serenity-js/serenity-js/issues/1682)
12
+
13
+
14
+ ### Features
15
+
16
+ * **core:** introduced support for Node.js 20, dropped support for Node.js 14 ([491fef8](https://github.com/serenity-js/serenity-js/commit/491fef8df672a2b40d247887b3da409dccbd26fd)), closes [#1678](https://github.com/serenity-js/serenity-js/issues/1678)
17
+
18
+
19
+
20
+
21
+
22
+ ## [3.1.6](https://github.com/serenity-js/serenity-js/compare/v3.1.5...v3.1.6) (2023-04-18)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **webdriverio:** upgraded to TypeScript 5 and WebdriverIO 7.31.1 ([15b1ba7](https://github.com/serenity-js/serenity-js/commit/15b1ba77e157d77123a2e8922414e937c0d2869d)), closes [#1558](https://github.com/serenity-js/serenity-js/issues/1558) [#1651](https://github.com/serenity-js/serenity-js/issues/1651)
28
+
29
+
30
+
31
+
32
+
6
33
  ## [3.1.5](https://github.com/serenity-js/serenity-js/compare/v3.1.4...v3.1.5) (2023-04-18)
7
34
 
8
35
  **Note:** Version bump only for package @serenity-js/assertions
package/README.md CHANGED
@@ -5,16 +5,23 @@
5
5
  [![Join Serenity/JS Community Chat](https://img.shields.io/badge/Chat-Serenity%2FJS%20Community-FBD30B?logo=matrix)](https://matrix.to/#/#serenity-js:gitter.im)
6
6
  [![Support Serenity/JS on GitHub](https://img.shields.io/badge/Support-@serenity--js-703EC8?logo=github)](https://github.com/sponsors/serenity-js)
7
7
 
8
- [Serenity/JS](https://serenity-js.org) is an innovative framework designed to make acceptance and regression testing
8
+ [Serenity/JS](https://serenity-js.org) is an innovative open-source framework designed to make acceptance and regression testing
9
9
  of complex software systems faster, more collaborative and easier to scale.
10
10
 
11
- To get started, check out the comprehensive [Serenity/JS Handbook](https://serenity-js.org/handbook), [API documentation](https://serenity-js.org/api/core), and [Serenity/JS project templates on GitHub](https://serenity-js.org/handbook/getting-started#serenityjs-project-templates).
11
+ ⭐️ Get started with Serenity/JS!
12
+ - [Serenity/JS Handbook](https://serenity-js.org/handbook) and [tutorial](https://serenity-js.org/handbook/web-testing/your-first-web-scenario),
13
+ - [API documentation](https://serenity-js.org/api/core),
14
+ - [Serenity/JS project templates on GitHub](https://serenity-js.org/handbook/getting-started#serenityjs-project-templates).
12
15
 
13
- If you have any questions or just want to say hello, join the [Serenity/JS Community Chat](https://matrix.to/#/#serenity-js:gitter.im).
16
+ 👋 Join the Serenity/JS Community!
17
+ - Meet other Serenity/JS developers and maintainers on the [Serenity/JS Community chat channel](https://matrix.to/#/#serenity-js:gitter.im),
18
+ - Find answers to your Serenity/JS questions on the [Serenity/JS Forum](https://github.com/orgs/serenity-js/discussions/categories/how-do-i),
19
+ - Learn how to [contribute to Serenity/JS](https://serenity-js.org/contributing),
20
+ - 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)!
14
21
 
15
22
  ## Serenity/JS Assertions
16
23
 
17
- [`@serenity-js/assertions`](https://serenity-js.org/modules/rest/) is an assertions library implementing the [Screenplay Pattern](https://serenity-js.org/handbook/thinking-in-serenity-js/screenplay-pattern.html).
24
+ [`@serenity-js/assertions`](https://serenity-js.org/api/rest/) is an assertions library implementing the [Screenplay Pattern](https://serenity-js.org/handbook/thinking-in-serenity-js/screenplay-pattern.html).
18
25
 
19
26
  ### Installation
20
27
 
@@ -100,4 +107,21 @@ await actorCalled('Erica').attemptsTo(
100
107
  );
101
108
  ```
102
109
 
110
+ ## 📣 Stay up to date
111
+
112
+ New features, tutorials, and demos are coming soon!
113
+ Follow [Serenity/JS on LinkedIn](https://www.linkedin.com/company/serenity-js),
114
+ subscribe to [Serenity/JS channel on YouTube](https://www.youtube.com/@serenity-js) and join the [Serenity/JS Community Chat](https://matrix.to/#/#serenity-js:gitter.im) to stay up to date!
115
+ Please also make sure to star ⭐️ [Serenity/JS on GitHub](https://github.com/serenity-js/serenity-js) to help others discover the framework!
116
+
117
+ [![Follow Serenity/JS on LinkedIn](https://img.shields.io/badge/Follow-Serenity%2FJS%20-0077B5?logo=linkedin)](https://www.linkedin.com/company/serenity-js)
118
+ [![Watch Serenity/JS on YouTube](https://img.shields.io/badge/Watch-@serenity--js-E62117?logo=youtube)](https://www.youtube.com/@serenity-js)
119
+ [![Join Serenity/JS Community Chat](https://img.shields.io/badge/Chat-Serenity%2FJS%20Community-FBD30B?logo=matrix)](https://matrix.to/#/#serenity-js:gitter.im)
120
+ [![GitHub stars](https://img.shields.io/github/stars/serenity-js/serenity-js?label=Serenity%2FJS&logo=github&style=badge)](https://github.com/serenity-js/serenity-js)
121
+
122
+ ## 💛 Support Serenity/JS
123
+
124
+ 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!
125
+
126
+ [![GitHub Sponsors](https://img.shields.io/badge/Support%20@serenity%2FJS-703EC8?style=for-the-badge&logo=github&logoColor=white)](https://github.com/sponsors/serenity-js)
103
127
 
@@ -20,5 +20,5 @@ import { Expectation } from '@serenity-js/core';
20
20
  *
21
21
  * @group Expectations
22
22
  */
23
- export declare const isCloseTo: (...answerableArguments: unknown[]) => Expectation<number>;
23
+ export declare const isCloseTo: (expected: import("@serenity-js/core").Answerable<number>, absoluteTolerance?: import("@serenity-js/core").Answerable<number>) => Expectation<number>;
24
24
  //# sourceMappingURL=isCloseTo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isCloseTo.d.ts","sourceRoot":"","sources":["../../src/expectations/isCloseTo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS,4DAgBrB,CAAA"}
1
+ {"version":3,"file":"isCloseTo.d.ts","sourceRoot":"","sources":["../../src/expectations/isCloseTo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS,uJAiBrB,CAAA"}
@@ -23,7 +23,9 @@ const core_1 = require("@serenity-js/core");
23
23
  *
24
24
  * @group Expectations
25
25
  */
26
- exports.isCloseTo = core_1.Expectation.define('isCloseTo', (expected, absoluteTolerance = 1e-9) => (0, core_1.d) `have value close to ${expected} ±${absoluteTolerance}`, (actual, expected, absoluteTolerance = 1e-9) => {
26
+ exports.isCloseTo = core_1.Expectation.define('isCloseTo', (expected, absoluteTolerance = 1e-9) => (0, core_1.d) `have value close to ${expected} ±${absoluteTolerance}`,
27
+ // eslint-disable-next-line @typescript-eslint/no-inferrable-types
28
+ (actual, expected, absoluteTolerance = 1e-9) => {
27
29
  // short-circuit exact equality
28
30
  if (actual === expected) {
29
31
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"isCloseTo.js","sourceRoot":"","sources":["../../src/expectations/isCloseTo.ts"],"names":[],"mappings":";;;AAAA,4CAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACU,QAAA,SAAS,GAAG,kBAAW,CAAC,MAAM,CACvC,WAAW,EAAE,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,EAAE,EAAE,CAAC,IAAA,QAAC,EAAA,uBAAwB,QAAS,KAAM,iBAAkB,EAAE,EACjH,CAAC,MAA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2
  "name": "@serenity-js/assertions",
3
- "version": "3.1.5",
3
+ "version": "3.2.0",
4
4
  "description": "Screenplay-style assertion library",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -16,7 +16,7 @@
16
16
  "access": "public"
17
17
  },
18
18
  "main": "lib/index.js",
19
- "typings": "lib/index.d.ts",
19
+ "types": "./lib/index.d.ts",
20
20
  "keywords": [
21
21
  "serenity-js",
22
22
  "cucumber",
@@ -27,7 +27,8 @@
27
27
  ],
28
28
  "scripts": {
29
29
  "clean": "rimraf target",
30
- "test": "nyc mocha --config ../../.mocharc.yml --reporter-options 'mocha-multi=.mocha-reporters.json' 'spec/**/*.spec.*'",
30
+ "test": "c8 npm run test:no-coverage",
31
+ "test:no-coverage": "mocha --config ../../.mocharc.yml --reporter-options 'mocha-multi=.mocha-reporters.json' 'spec/**/*.spec.*'",
31
32
  "compile": "rimraf lib && tsc --project tsconfig.build.json"
32
33
  },
33
34
  "repository": {
@@ -39,22 +40,21 @@
39
40
  "url": "https://github.com/serenity-js/serenity-js/issues"
40
41
  },
41
42
  "engines": {
42
- "node": "^14 || ^16 || ^18",
43
- "npm": "^6 || ^7 || ^8 || ^9"
43
+ "node": "^16.13 || ^18.12 || ^20"
44
44
  },
45
45
  "dependencies": {
46
- "@serenity-js/core": "3.1.5",
46
+ "@serenity-js/core": "3.2.0",
47
47
  "tiny-types": "^1.19.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@integration/testing-tools": "3.0.0",
51
51
  "@types/chai": "^4.3.4",
52
52
  "@types/mocha": "^10.0.1",
53
+ "c8": "7.13.0",
53
54
  "mocha": "^10.2.0",
54
55
  "mocha-multi": "^1.1.7",
55
- "nyc": "15.1.0",
56
56
  "ts-node": "^10.9.1",
57
- "typescript": "^4.9.5"
57
+ "typescript": "^5.0.4"
58
58
  },
59
- "gitHead": "31f621a7c827e20ba07a86a2f7c77d941784bb0a"
59
+ "gitHead": "e69cea764f50991c3ad742f28926b4345b3e2422"
60
60
  }
@@ -23,7 +23,8 @@ import { d, Expectation } from '@serenity-js/core';
23
23
  */
24
24
  export const isCloseTo = Expectation.define(
25
25
  'isCloseTo', (expected, absoluteTolerance = 1e-9) => d`have value close to ${ expected } ±${ absoluteTolerance }`,
26
- (actual: number, expected: number, absoluteTolerance = 1e-9) => {
26
+ // eslint-disable-next-line @typescript-eslint/no-inferrable-types
27
+ (actual: number, expected: number, absoluteTolerance: number = 1e-9) => {
27
28
  // short-circuit exact equality
28
29
  if (actual === expected) {
29
30
  return true;