@serenity-js/assertions 3.41.2 → 3.42.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.
Files changed (133) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/esm/Ensure.d.ts +110 -0
  3. package/esm/Ensure.d.ts.map +1 -0
  4. package/esm/Ensure.js +148 -0
  5. package/esm/Ensure.js.map +1 -0
  6. package/esm/EnsureEventually.d.ts +98 -0
  7. package/esm/EnsureEventually.d.ts.map +1 -0
  8. package/esm/EnsureEventually.js +142 -0
  9. package/esm/EnsureEventually.js.map +1 -0
  10. package/esm/expectations/and.d.ts +23 -0
  11. package/esm/expectations/and.d.ts.map +1 -0
  12. package/esm/expectations/and.js +46 -0
  13. package/esm/expectations/and.js.map +1 -0
  14. package/esm/expectations/contain.d.ts +27 -0
  15. package/esm/expectations/contain.d.ts.map +1 -0
  16. package/esm/expectations/contain.js +28 -0
  17. package/esm/expectations/contain.js.map +1 -0
  18. package/esm/expectations/containAtLeastOneItemThat.d.ts +24 -0
  19. package/esm/expectations/containAtLeastOneItemThat.d.ts.map +1 -0
  20. package/esm/expectations/containAtLeastOneItemThat.js +53 -0
  21. package/esm/expectations/containAtLeastOneItemThat.js.map +1 -0
  22. package/esm/expectations/containItemsWhereEachItem.d.ts +24 -0
  23. package/esm/expectations/containItemsWhereEachItem.d.ts.map +1 -0
  24. package/esm/expectations/containItemsWhereEachItem.js +53 -0
  25. package/esm/expectations/containItemsWhereEachItem.js.map +1 -0
  26. package/esm/expectations/endsWith.d.ts +22 -0
  27. package/esm/expectations/endsWith.d.ts.map +1 -0
  28. package/esm/expectations/endsWith.js +22 -0
  29. package/esm/expectations/endsWith.js.map +1 -0
  30. package/esm/expectations/equals.d.ts +28 -0
  31. package/esm/expectations/equals.d.ts.map +1 -0
  32. package/esm/expectations/equals.js +29 -0
  33. package/esm/expectations/equals.js.map +1 -0
  34. package/esm/expectations/includes.d.ts +41 -0
  35. package/esm/expectations/includes.d.ts.map +1 -0
  36. package/esm/expectations/includes.js +41 -0
  37. package/esm/expectations/includes.js.map +1 -0
  38. package/esm/expectations/index.d.ts +21 -0
  39. package/esm/expectations/index.d.ts.map +1 -0
  40. package/esm/expectations/index.js +21 -0
  41. package/esm/expectations/index.js.map +1 -0
  42. package/esm/expectations/isAfter.d.ts +42 -0
  43. package/esm/expectations/isAfter.d.ts.map +1 -0
  44. package/esm/expectations/isAfter.js +50 -0
  45. package/esm/expectations/isAfter.js.map +1 -0
  46. package/esm/expectations/isBefore.d.ts +42 -0
  47. package/esm/expectations/isBefore.d.ts.map +1 -0
  48. package/esm/expectations/isBefore.js +50 -0
  49. package/esm/expectations/isBefore.js.map +1 -0
  50. package/esm/expectations/isCloseTo.d.ts +24 -0
  51. package/esm/expectations/isCloseTo.d.ts.map +1 -0
  52. package/esm/expectations/isCloseTo.js +34 -0
  53. package/esm/expectations/isCloseTo.js.map +1 -0
  54. package/esm/expectations/isFalse.d.ts +21 -0
  55. package/esm/expectations/isFalse.d.ts.map +1 -0
  56. package/esm/expectations/isFalse.js +24 -0
  57. package/esm/expectations/isFalse.js.map +1 -0
  58. package/esm/expectations/isGreaterThan.d.ts +45 -0
  59. package/esm/expectations/isGreaterThan.d.ts.map +1 -0
  60. package/esm/expectations/isGreaterThan.js +45 -0
  61. package/esm/expectations/isGreaterThan.js.map +1 -0
  62. package/esm/expectations/isLessThan.d.ts +45 -0
  63. package/esm/expectations/isLessThan.d.ts.map +1 -0
  64. package/esm/expectations/isLessThan.js +45 -0
  65. package/esm/expectations/isLessThan.js.map +1 -0
  66. package/esm/expectations/isPresent.d.ts +65 -0
  67. package/esm/expectations/isPresent.d.ts.map +1 -0
  68. package/esm/expectations/isPresent.js +96 -0
  69. package/esm/expectations/isPresent.js.map +1 -0
  70. package/esm/expectations/isTrue.d.ts +21 -0
  71. package/esm/expectations/isTrue.d.ts.map +1 -0
  72. package/esm/expectations/isTrue.js +24 -0
  73. package/esm/expectations/isTrue.js.map +1 -0
  74. package/esm/expectations/matches.d.ts +22 -0
  75. package/esm/expectations/matches.d.ts.map +1 -0
  76. package/esm/expectations/matches.js +22 -0
  77. package/esm/expectations/matches.js.map +1 -0
  78. package/esm/expectations/not.d.ts +24 -0
  79. package/esm/expectations/not.d.ts.map +1 -0
  80. package/esm/expectations/not.js +48 -0
  81. package/esm/expectations/not.js.map +1 -0
  82. package/esm/expectations/or.d.ts +23 -0
  83. package/esm/expectations/or.d.ts.map +1 -0
  84. package/esm/expectations/or.js +53 -0
  85. package/esm/expectations/or.js.map +1 -0
  86. package/esm/expectations/property.d.ts +62 -0
  87. package/esm/expectations/property.d.ts.map +1 -0
  88. package/esm/expectations/property.js +82 -0
  89. package/esm/expectations/property.js.map +1 -0
  90. package/esm/expectations/startsWith.d.ts +22 -0
  91. package/esm/expectations/startsWith.d.ts.map +1 -0
  92. package/esm/expectations/startsWith.js +22 -0
  93. package/esm/expectations/startsWith.js.map +1 -0
  94. package/esm/index.d.ts +4 -0
  95. package/esm/index.d.ts.map +1 -0
  96. package/esm/index.js +4 -0
  97. package/esm/index.js.map +1 -0
  98. package/lib/Ensure.d.ts +1 -1
  99. package/lib/Ensure.d.ts.map +1 -1
  100. package/lib/Ensure.js +2 -2
  101. package/lib/Ensure.js.map +1 -1
  102. package/lib/EnsureEventually.d.ts +1 -1
  103. package/lib/EnsureEventually.d.ts.map +1 -1
  104. package/lib/expectations/contain.js +2 -2
  105. package/lib/expectations/contain.js.map +1 -1
  106. package/lib/expectations/equals.js +2 -2
  107. package/lib/expectations/equals.js.map +1 -1
  108. package/lib/expectations/index.d.ts +20 -20
  109. package/lib/expectations/index.d.ts.map +1 -1
  110. package/lib/expectations/index.js +20 -20
  111. package/lib/expectations/index.js.map +1 -1
  112. package/lib/expectations/isAfter.d.ts +1 -1
  113. package/lib/expectations/isBefore.d.ts +1 -1
  114. package/lib/expectations/isFalse.js +2 -2
  115. package/lib/expectations/isFalse.js.map +1 -1
  116. package/lib/expectations/isTrue.js +2 -2
  117. package/lib/expectations/isTrue.js.map +1 -1
  118. package/lib/index.d.ts +3 -3
  119. package/lib/index.d.ts.map +1 -1
  120. package/lib/index.js +3 -3
  121. package/lib/index.js.map +1 -1
  122. package/lib/package.json +1 -0
  123. package/package.json +31 -8
  124. package/src/Ensure.ts +2 -2
  125. package/src/EnsureEventually.ts +1 -1
  126. package/src/expectations/contain.ts +1 -1
  127. package/src/expectations/equals.ts +1 -1
  128. package/src/expectations/index.ts +20 -20
  129. package/src/expectations/isFalse.ts +1 -1
  130. package/src/expectations/isTrue.ts +1 -1
  131. package/src/index.ts +3 -3
  132. package/tsconfig-cjs.build.json +17 -0
  133. package/tsconfig-esm.build.json +18 -0
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isFalse = isFalse;
4
4
  const core_1 = require("@serenity-js/core");
5
- const equals_1 = require("./equals");
5
+ const equals_js_1 = require("./equals.js");
6
6
  /**
7
7
  * Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `boolean` value
8
8
  * is `false`.
@@ -22,6 +22,6 @@ const equals_1 = require("./equals");
22
22
  * @group Expectations
23
23
  */
24
24
  function isFalse() {
25
- return core_1.Expectation.to(`equal false`).soThatActual((0, equals_1.equals)(false));
25
+ return core_1.Expectation.to(`equal false`).soThatActual((0, equals_js_1.equals)(false));
26
26
  }
27
27
  //# sourceMappingURL=isFalse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isFalse.js","sourceRoot":"","sources":["../../src/expectations/isFalse.ts"],"names":[],"mappings":";;AAsBA,0BAEC;AAxBD,4CAAgD;AAEhD,qCAAkC;AAElC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,OAAO;IACnB,OAAO,kBAAW,CAAC,EAAE,CAAU,aAAa,CAAC,CAAC,YAAY,CAAC,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,CAAC;AAC9E,CAAC"}
1
+ {"version":3,"file":"isFalse.js","sourceRoot":"","sources":["../../src/expectations/isFalse.ts"],"names":[],"mappings":";;AAsBA,0BAEC;AAxBD,4CAAgD;AAEhD,2CAAqC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,OAAO;IACnB,OAAO,kBAAW,CAAC,EAAE,CAAU,aAAa,CAAC,CAAC,YAAY,CAAC,IAAA,kBAAM,EAAC,KAAK,CAAC,CAAC,CAAC;AAC9E,CAAC"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isTrue = isTrue;
4
4
  const core_1 = require("@serenity-js/core");
5
- const equals_1 = require("./equals");
5
+ const equals_js_1 = require("./equals.js");
6
6
  /**
7
7
  * Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `boolean` value
8
8
  * is `true`.
@@ -22,6 +22,6 @@ const equals_1 = require("./equals");
22
22
  * @group Expectations
23
23
  */
24
24
  function isTrue() {
25
- return core_1.Expectation.to(`equal true`).soThatActual((0, equals_1.equals)(true));
25
+ return core_1.Expectation.to(`equal true`).soThatActual((0, equals_js_1.equals)(true));
26
26
  }
27
27
  //# sourceMappingURL=isTrue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isTrue.js","sourceRoot":"","sources":["../../src/expectations/isTrue.ts"],"names":[],"mappings":";;AAsBA,wBAEC;AAxBD,4CAAgD;AAEhD,qCAAkC;AAElC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,MAAM;IAClB,OAAO,kBAAW,CAAC,EAAE,CAAU,YAAY,CAAC,CAAC,YAAY,CAAC,IAAA,eAAM,EAAC,IAAI,CAAC,CAAC,CAAC;AAC5E,CAAC"}
1
+ {"version":3,"file":"isTrue.js","sourceRoot":"","sources":["../../src/expectations/isTrue.ts"],"names":[],"mappings":";;AAsBA,wBAEC;AAxBD,4CAAgD;AAEhD,2CAAqC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,MAAM;IAClB,OAAO,kBAAW,CAAC,EAAE,CAAU,YAAY,CAAC,CAAC,YAAY,CAAC,IAAA,kBAAM,EAAC,IAAI,CAAC,CAAC,CAAC;AAC5E,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './Ensure';
2
- export * from './EnsureEventually';
3
- export * from './expectations';
1
+ export * from './Ensure.js';
2
+ export * from './EnsureEventually.js';
3
+ export * from './expectations/index.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
package/lib/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Ensure"), exports);
18
- __exportStar(require("./EnsureEventually"), exports);
19
- __exportStar(require("./expectations"), exports);
17
+ __exportStar(require("./Ensure.js"), exports);
18
+ __exportStar(require("./EnsureEventually.js"), exports);
19
+ __exportStar(require("./expectations/index.js"), exports);
20
20
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,qDAAmC;AACnC,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,wDAAsC;AACtC,0DAAwC"}
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-js/assertions",
3
- "version": "3.41.2",
3
+ "version": "3.42.0",
4
4
  "description": "Serenity/JS universal assertion library supporting all types of functional tests, including both web and REST API scenarios",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -16,8 +16,27 @@
16
16
  "access": "public",
17
17
  "provenance": true
18
18
  },
19
- "main": "lib/index.js",
19
+ "main": "./lib/index.js",
20
20
  "types": "./lib/index.d.ts",
21
+ "type": "module",
22
+ "module": "./esm/index.js",
23
+ "exports": {
24
+ ".": {
25
+ "import": {
26
+ "types": "./esm/index.d.ts",
27
+ "default": "./esm/index.js"
28
+ },
29
+ "require": {
30
+ "types": "./lib/index.d.ts",
31
+ "default": "./lib/index.js"
32
+ }
33
+ },
34
+ "./lib/*.js": "./lib/*.js",
35
+ "./lib/*": "./lib/*",
36
+ "./esm/*.js": "./esm/*.js",
37
+ "./esm/*": "./esm/*.js",
38
+ "./package.json": "./package.json"
39
+ },
21
40
  "keywords": [
22
41
  "automation",
23
42
  "integration",
@@ -33,8 +52,12 @@
33
52
  "scripts": {
34
53
  "clean": "rimraf target",
35
54
  "test": "c8 npm run test:no-coverage",
36
- "test:no-coverage": "mocha --config ../../.mocharc.yml --spec='spec/**/*.spec.*'",
37
- "compile": "rimraf lib && tsc --project tsconfig.build.json"
55
+ "test:no-coverage": "mocha --config .mocharc.yml --spec='spec/**/*.spec.*'",
56
+ "compile": "npm run compile:clean && npm run compile:esm && npm run compile:cjs-package && npm run compile:cjs",
57
+ "compile:clean": "rimraf lib esm",
58
+ "compile:esm": "tsc --project tsconfig-esm.build.json",
59
+ "compile:cjs-package": "node -e \"require('fs').mkdirSync('lib', { recursive: true }); require('fs').writeFileSync('lib/package.json', '{ \\\"type\\\": \\\"commonjs\\\" }')\"",
60
+ "compile:cjs": "tsc --project tsconfig-cjs.build.json"
38
61
  },
39
62
  "repository": {
40
63
  "type": "git",
@@ -48,8 +71,8 @@
48
71
  "node": "^20 || ^22 || ^24"
49
72
  },
50
73
  "dependencies": {
51
- "@serenity-js/core": "3.41.2",
52
- "tiny-types": "1.24.3"
74
+ "@serenity-js/core": "3.42.0",
75
+ "tiny-types": "2.0.5"
53
76
  },
54
77
  "devDependencies": {
55
78
  "@integration/testing-tools": "3.0.0",
@@ -58,8 +81,8 @@
58
81
  "c8": "11.0.0",
59
82
  "mocha": "11.7.5",
60
83
  "mocha-multi": "1.1.7",
61
- "ts-node": "10.9.2",
84
+ "tsx": "4.21.0",
62
85
  "typescript": "5.9.3"
63
86
  },
64
- "gitHead": "adcfe0c84d167de23a9194d755a90a2fb2b8112d"
87
+ "gitHead": "a415b0066807d7bab9f34b1ceef66a26156aafe1"
65
88
  }
package/src/Ensure.ts CHANGED
@@ -18,9 +18,9 @@ import {
18
18
  RaiseErrors,
19
19
  the
20
20
  } from '@serenity-js/core';
21
- import type { FileSystemLocation } from '@serenity-js/core/lib/io';
21
+ import type { FileSystemLocation } from '@serenity-js/core/io';
22
22
 
23
- import { EnsureEventually } from './EnsureEventually';
23
+ import { EnsureEventually } from './EnsureEventually.js';
24
24
 
25
25
  /**
26
26
  * The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `Ensure`
@@ -19,7 +19,7 @@ import {
19
19
  the,
20
20
  TimeoutExpiredError
21
21
  } from '@serenity-js/core';
22
- import type { FileSystemLocation } from '@serenity-js/core/lib/io';
22
+ import type { FileSystemLocation } from '@serenity-js/core/io';
23
23
 
24
24
  /**
25
25
  * The [interaction](https://serenity-js.org/api/core/class/Interaction/) to `EnsureEventually`
@@ -1,5 +1,5 @@
1
1
  import { Expectation } from '@serenity-js/core';
2
- import { equal } from 'tiny-types/lib/objects';
2
+ import { equal } from 'tiny-types/lib/objects/index.js';
3
3
 
4
4
  /**
5
5
  * Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual array of `Item[]` contains
@@ -1,5 +1,5 @@
1
1
  import { Expectation } from '@serenity-js/core';
2
- import { equal } from 'tiny-types/lib/objects';
2
+ import { equal } from 'tiny-types/lib/objects/index.js';
3
3
 
4
4
  /**
5
5
  * Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value
@@ -1,20 +1,20 @@
1
- export * from './and';
2
- export * from './contain';
3
- export * from './containAtLeastOneItemThat';
4
- export * from './containItemsWhereEachItem';
5
- export * from './endsWith';
6
- export * from './equals';
7
- export * from './includes';
8
- export * from './isAfter';
9
- export * from './isBefore';
10
- export * from './isCloseTo';
11
- export * from './isFalse';
12
- export * from './isGreaterThan';
13
- export * from './isLessThan';
14
- export * from './isPresent';
15
- export * from './isTrue';
16
- export * from './matches';
17
- export * from './not';
18
- export * from './or';
19
- export * from './property';
20
- export * from './startsWith';
1
+ export * from './and.js';
2
+ export * from './contain.js';
3
+ export * from './containAtLeastOneItemThat.js';
4
+ export * from './containItemsWhereEachItem.js';
5
+ export * from './endsWith.js';
6
+ export * from './equals.js';
7
+ export * from './includes.js';
8
+ export * from './isAfter.js';
9
+ export * from './isBefore.js';
10
+ export * from './isCloseTo.js';
11
+ export * from './isFalse.js';
12
+ export * from './isGreaterThan.js';
13
+ export * from './isLessThan.js';
14
+ export * from './isPresent.js';
15
+ export * from './isTrue.js';
16
+ export * from './matches.js';
17
+ export * from './not.js';
18
+ export * from './or.js';
19
+ export * from './property.js';
20
+ export * from './startsWith.js';
@@ -1,6 +1,6 @@
1
1
  import { Expectation } from '@serenity-js/core';
2
2
 
3
- import { equals } from './equals';
3
+ import { equals } from './equals.js';
4
4
 
5
5
  /**
6
6
  * Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `boolean` value
@@ -1,6 +1,6 @@
1
1
  import { Expectation } from '@serenity-js/core';
2
2
 
3
- import { equals } from './equals';
3
+ import { equals } from './equals.js';
4
4
 
5
5
  /**
6
6
  * Creates an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual `boolean` value
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './Ensure';
2
- export * from './EnsureEventually';
3
- export * from './expectations';
1
+ export * from './Ensure.js';
2
+ export * from './EnsureEventually.js';
3
+ export * from './expectations/index.js';
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "module": "CommonJS",
5
+ "moduleResolution": "Node",
6
+ "outDir": "lib",
7
+ "rootDir": "src",
8
+ "target": "es2022",
9
+ "lib": [
10
+ "es2022"
11
+ ],
12
+ "skipLibCheck": true
13
+ },
14
+ "include": [
15
+ "src/**/*.ts"
16
+ ]
17
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "../../tsconfig-esm.options.json",
3
+ "compilerOptions": {
4
+ "module": "Node20",
5
+ "moduleResolution": "Node16",
6
+ "outDir": "esm",
7
+ "rootDir": "src",
8
+ "target": "es2022",
9
+ "lib": [
10
+ "es2022"
11
+ ],
12
+ "skipLibCheck": true,
13
+ "rewriteRelativeImportExtensions": true
14
+ },
15
+ "include": [
16
+ "src/**/*.ts"
17
+ ]
18
+ }