@clipboard-health/testing-core 0.7.2 → 0.7.3
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/README.md +2 -2
- package/package.json +2 -2
- package/src/lib/expectToBeDefined.js +2 -2
- package/src/lib/expectToBeDefined.js.map +1 -1
- package/src/lib/expectToBeLeft.d.ts +1 -1
- package/src/lib/expectToBeLeft.js +2 -2
- package/src/lib/expectToBeLeft.js.map +1 -1
- package/src/lib/expectToBeNone.d.ts +1 -1
- package/src/lib/expectToBeNone.js +2 -2
- package/src/lib/expectToBeNone.js.map +1 -1
- package/src/lib/expectToBeRight.d.ts +1 -1
- package/src/lib/expectToBeRight.js +2 -2
- package/src/lib/expectToBeRight.js.map +1 -1
- package/src/lib/expectToBeSome.d.ts +1 -1
- package/src/lib/expectToBeSome.js +2 -2
- package/src/lib/expectToBeSome.js.map +1 -1
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ ok(length === 2);
|
|
|
62
62
|
import { ok } from "node:assert/strict";
|
|
63
63
|
|
|
64
64
|
import { expectToBeLeft } from "@clipboard-health/testing-core";
|
|
65
|
-
import { either as E } from "@clipboard-health/util-
|
|
65
|
+
import { either as E } from "@clipboard-health/util-ts";
|
|
66
66
|
|
|
67
67
|
function divide(numerator: number, denominator: number): E.Either<string, number> {
|
|
68
68
|
if (denominator === 0) {
|
|
@@ -87,7 +87,7 @@ ok(value.left === "Cannot divide by zero");
|
|
|
87
87
|
import { ok } from "node:assert/strict";
|
|
88
88
|
|
|
89
89
|
import { expectToBeRight } from "@clipboard-health/testing-core";
|
|
90
|
-
import { either as E } from "@clipboard-health/util-
|
|
90
|
+
import { either as E } from "@clipboard-health/util-ts";
|
|
91
91
|
|
|
92
92
|
function divide(numerator: number, denominator: number): E.Either<string, number> {
|
|
93
93
|
if (denominator === 0) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipboard-health/testing-core",
|
|
3
3
|
"description": "TypeScript-friendly testing utilities.",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.3",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@clipboard-health/util-
|
|
6
|
+
"@clipboard-health/util-ts": "2.9.0",
|
|
7
7
|
"tslib": "2.8.0",
|
|
8
8
|
"zod": "3.23.8"
|
|
9
9
|
},
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.expectToBeDefined = expectToBeDefined;
|
|
4
4
|
const strict_1 = require("node:assert/strict");
|
|
5
|
-
const
|
|
5
|
+
const util_ts_1 = require("@clipboard-health/util-ts");
|
|
6
6
|
/**
|
|
7
7
|
* Asserts and narrows the type for defined values.
|
|
8
8
|
*
|
|
9
9
|
* @throws {AssertionError} for null or undefined values.
|
|
10
10
|
*/
|
|
11
11
|
function expectToBeDefined(value) {
|
|
12
|
-
(0, strict_1.ok)((0,
|
|
12
|
+
(0, strict_1.ok)((0, util_ts_1.isDefined)(value), "Expected value to be defined, got null or undefined");
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=expectToBeDefined.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectToBeDefined.js","sourceRoot":"","sources":["../../../../../packages/testing-core/src/lib/expectToBeDefined.ts"],"names":[],"mappings":";;AASA,8CAEC;AAXD,+CAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"expectToBeDefined.js","sourceRoot":"","sources":["../../../../../packages/testing-core/src/lib/expectToBeDefined.ts"],"names":[],"mappings":";;AASA,8CAEC;AAXD,+CAAwC;AAExC,uDAAsD;AAEtD;;;;GAIG;AACH,SAAgB,iBAAiB,CAAI,KAAoB;IACvD,IAAA,WAAE,EAAC,IAAA,mBAAS,EAAC,KAAK,CAAC,EAAE,qDAAqD,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.expectToBeLeft = expectToBeLeft;
|
|
4
4
|
const strict_1 = require("node:assert/strict");
|
|
5
|
-
const
|
|
5
|
+
const util_ts_1 = require("@clipboard-health/util-ts");
|
|
6
6
|
const expectToBeDefined_1 = require("./expectToBeDefined");
|
|
7
7
|
/**
|
|
8
8
|
* Asserts and narrows the type of the provided Either value to Left.
|
|
@@ -11,6 +11,6 @@ const expectToBeDefined_1 = require("./expectToBeDefined");
|
|
|
11
11
|
*/
|
|
12
12
|
function expectToBeLeft(value) {
|
|
13
13
|
(0, expectToBeDefined_1.expectToBeDefined)(value);
|
|
14
|
-
(0, strict_1.ok)(
|
|
14
|
+
(0, strict_1.ok)(util_ts_1.either.isLeft(value));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=expectToBeLeft.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectToBeLeft.js","sourceRoot":"","sources":["../../../../../packages/testing-core/src/lib/expectToBeLeft.ts"],"names":[],"mappings":";;AAWA,wCAKC;AAhBD,+CAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"expectToBeLeft.js","sourceRoot":"","sources":["../../../../../packages/testing-core/src/lib/expectToBeLeft.ts"],"names":[],"mappings":";;AAWA,wCAKC;AAhBD,+CAAwC;AAExC,uDAAwD;AAExD,2DAAwD;AAExD;;;;GAIG;AACH,SAAgB,cAAc,CAC5B,KAAiC;IAEjC,IAAA,qCAAiB,EAAC,KAAK,CAAC,CAAC;IACzB,IAAA,WAAE,EAAC,gBAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.expectToBeNone = expectToBeNone;
|
|
4
4
|
const strict_1 = require("node:assert/strict");
|
|
5
|
-
const
|
|
5
|
+
const util_ts_1 = require("@clipboard-health/util-ts");
|
|
6
6
|
const expectToBeDefined_1 = require("./expectToBeDefined");
|
|
7
7
|
/**
|
|
8
8
|
* Asserts and narrows the type of the provided Option value to None.
|
|
@@ -11,6 +11,6 @@ const expectToBeDefined_1 = require("./expectToBeDefined");
|
|
|
11
11
|
*/
|
|
12
12
|
function expectToBeNone(value) {
|
|
13
13
|
(0, expectToBeDefined_1.expectToBeDefined)(value);
|
|
14
|
-
(0, strict_1.ok)(
|
|
14
|
+
(0, strict_1.ok)(util_ts_1.option.isNone(value));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=expectToBeNone.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectToBeNone.js","sourceRoot":"","sources":["../../../../../packages/testing-core/src/lib/expectToBeNone.ts"],"names":[],"mappings":";;AAWA,wCAGC;AAdD,+CAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"expectToBeNone.js","sourceRoot":"","sources":["../../../../../packages/testing-core/src/lib/expectToBeNone.ts"],"names":[],"mappings":";;AAWA,wCAGC;AAdD,+CAAwC;AAExC,uDAAwD;AAExD,2DAAwD;AAExD;;;;GAIG;AACH,SAAgB,cAAc,CAAI,KAA8B;IAC9D,IAAA,qCAAiB,EAAC,KAAK,CAAC,CAAC;IACzB,IAAA,WAAE,EAAC,gBAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.expectToBeRight = expectToBeRight;
|
|
4
4
|
const strict_1 = require("node:assert/strict");
|
|
5
|
-
const
|
|
5
|
+
const util_ts_1 = require("@clipboard-health/util-ts");
|
|
6
6
|
const expectToBeDefined_1 = require("./expectToBeDefined");
|
|
7
7
|
/**
|
|
8
8
|
* Asserts and narrows the type of the provided Either value to Right.
|
|
@@ -11,6 +11,6 @@ const expectToBeDefined_1 = require("./expectToBeDefined");
|
|
|
11
11
|
*/
|
|
12
12
|
function expectToBeRight(value) {
|
|
13
13
|
(0, expectToBeDefined_1.expectToBeDefined)(value);
|
|
14
|
-
(0, strict_1.ok)(
|
|
14
|
+
(0, strict_1.ok)(util_ts_1.either.isRight(value));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=expectToBeRight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectToBeRight.js","sourceRoot":"","sources":["../../../../../packages/testing-core/src/lib/expectToBeRight.ts"],"names":[],"mappings":";;AAWA,0CAKC;AAhBD,+CAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"expectToBeRight.js","sourceRoot":"","sources":["../../../../../packages/testing-core/src/lib/expectToBeRight.ts"],"names":[],"mappings":";;AAWA,0CAKC;AAhBD,+CAAwC;AAExC,uDAAwD;AAExD,2DAAwD;AAExD;;;;GAIG;AACH,SAAgB,eAAe,CAC7B,KAAiC;IAEjC,IAAA,qCAAiB,EAAC,KAAK,CAAC,CAAC;IACzB,IAAA,WAAE,EAAC,gBAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.expectToBeSome = expectToBeSome;
|
|
4
4
|
const strict_1 = require("node:assert/strict");
|
|
5
|
-
const
|
|
5
|
+
const util_ts_1 = require("@clipboard-health/util-ts");
|
|
6
6
|
const expectToBeDefined_1 = require("./expectToBeDefined");
|
|
7
7
|
/**
|
|
8
8
|
* Asserts and narrows the type of the provided Option value to Some.
|
|
@@ -11,6 +11,6 @@ const expectToBeDefined_1 = require("./expectToBeDefined");
|
|
|
11
11
|
*/
|
|
12
12
|
function expectToBeSome(value) {
|
|
13
13
|
(0, expectToBeDefined_1.expectToBeDefined)(value);
|
|
14
|
-
(0, strict_1.ok)(
|
|
14
|
+
(0, strict_1.ok)(util_ts_1.option.isSome(value));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=expectToBeSome.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectToBeSome.js","sourceRoot":"","sources":["../../../../../packages/testing-core/src/lib/expectToBeSome.ts"],"names":[],"mappings":";;AAWA,wCAGC;AAdD,+CAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"expectToBeSome.js","sourceRoot":"","sources":["../../../../../packages/testing-core/src/lib/expectToBeSome.ts"],"names":[],"mappings":";;AAWA,wCAGC;AAdD,+CAAwC;AAExC,uDAAwD;AAExD,2DAAwD;AAExD;;;;GAIG;AACH,SAAgB,cAAc,CAAI,KAA8B;IAC9D,IAAA,qCAAiB,EAAC,KAAK,CAAC,CAAC;IACzB,IAAA,WAAE,EAAC,gBAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACtB,CAAC"}
|