assertron 11.5.2 → 11.5.4
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 +7 -7
- package/cjs/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/defineProperty.js +12 -0
- package/cjs/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/toPrimitive.js +14 -0
- package/cjs/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/toPropertyKey.js +9 -0
- package/cjs/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/typeof.js +16 -0
- package/cjs/_virtual/_rolldown/runtime.js +23 -0
- package/cjs/assert-order/AssertOrder.d.ts +42 -39
- package/cjs/assert-order/AssertOrder.d.ts.map +1 -1
- package/cjs/assert-order/AssertOrder.js +118 -146
- package/cjs/assert-order/AssertOrder.js.map +1 -1
- package/cjs/assert-order/InvalidOrder.d.ts +10 -7
- package/cjs/assert-order/InvalidOrder.d.ts.map +1 -1
- package/cjs/assert-order/InvalidOrder.js +24 -43
- package/cjs/assert-order/InvalidOrder.js.map +1 -1
- package/cjs/assert-order/StateMachine.js +101 -156
- package/cjs/assert-order/StateMachine.js.map +1 -1
- package/cjs/assert-order/index.d.ts +4 -4
- package/cjs/assert-order/types.d.ts +9 -6
- package/cjs/assert-order/types.d.ts.map +1 -1
- package/cjs/assertron/assertron.d.ts +23 -20
- package/cjs/assertron/assertron.d.ts.map +1 -1
- package/cjs/assertron/assertron.js +36 -39
- package/cjs/assertron/assertron.js.map +1 -1
- package/cjs/assertron/falsy.js +5 -6
- package/cjs/assertron/falsy.js.map +1 -1
- package/cjs/assertron/index.d.ts +3 -3
- package/cjs/assertron/isInstanceof.js +6 -7
- package/cjs/assertron/isInstanceof.js.map +1 -1
- package/cjs/assertron/pathEqual.js +7 -8
- package/cjs/assertron/pathEqual.js.map +1 -1
- package/cjs/assertron/rejects.js +8 -8
- package/cjs/assertron/rejects.js.map +1 -1
- package/cjs/assertron/repeat.js +23 -31
- package/cjs/assertron/repeat.js.map +1 -1
- package/cjs/assertron/resolves.js +8 -8
- package/cjs/assertron/resolves.js.map +1 -1
- package/cjs/assertron/satisfies.d.ts +5 -10
- package/cjs/assertron/satisfies.d.ts.map +1 -1
- package/cjs/assertron/satisfies.js +12 -14
- package/cjs/assertron/satisfies.js.map +1 -1
- package/cjs/assertron/throws.js +48 -55
- package/cjs/assertron/throws.js.map +1 -1
- package/cjs/assertron/truthy.js +5 -6
- package/cjs/assertron/truthy.js.map +1 -1
- package/cjs/errors.d.ts +13 -10
- package/cjs/errors.d.ts.map +1 -1
- package/cjs/errors.js +19 -29
- package/cjs/errors.js.map +1 -1
- package/cjs/index.d.ts +10 -8
- package/cjs/index.js +98 -37
- package/cjs/index.js.map +1 -1
- package/cjs/package.json +3 -1
- package/cjs/types.d.ts +5 -2
- package/cjs/types.d.ts.map +1 -1
- package/cjs/utils/index.js +18 -25
- package/cjs/utils/index.js.map +1 -1
- package/cjs/utils/isErrorConstructor.js +4 -4
- package/cjs/utils/isErrorConstructor.js.map +1 -1
- package/cjs/utils/notEqualMessage.js +4 -4
- package/cjs/utils/notEqualMessage.js.map +1 -1
- package/cjs/utils/notSatisfiedMessage.js +14 -23
- package/cjs/utils/notSatisfiedMessage.js.map +1 -1
- package/cjs/utils/notThrownMessage.js +5 -5
- package/cjs/utils/notThrownMessage.js.map +1 -1
- package/cjs/utils/promiseMessages.js +7 -13
- package/cjs/utils/promiseMessages.js.map +1 -1
- package/cjs/utils/unexpectedErrorMessage.js +6 -6
- package/cjs/utils/unexpectedErrorMessage.js.map +1 -1
- package/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/defineProperty.js +12 -0
- package/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/toPrimitive.js +14 -0
- package/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/toPropertyKey.js +9 -0
- package/esm/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/typeof.js +11 -0
- package/esm/assert-order/AssertOrder.d.ts +42 -39
- package/esm/assert-order/AssertOrder.d.ts.map +1 -1
- package/esm/assert-order/AssertOrder.js +119 -143
- package/esm/assert-order/AssertOrder.js.map +1 -1
- package/esm/assert-order/InvalidOrder.d.ts +10 -7
- package/esm/assert-order/InvalidOrder.d.ts.map +1 -1
- package/esm/assert-order/InvalidOrder.js +24 -39
- package/esm/assert-order/InvalidOrder.js.map +1 -1
- package/esm/assert-order/StateMachine.js +99 -129
- package/esm/assert-order/StateMachine.js.map +1 -1
- package/esm/assert-order/index.d.ts +4 -4
- package/esm/assert-order/types.d.ts +9 -6
- package/esm/assert-order/types.d.ts.map +1 -1
- package/esm/assertron/assertron.d.ts +23 -20
- package/esm/assertron/assertron.d.ts.map +1 -1
- package/esm/assertron/assertron.js +36 -36
- package/esm/assertron/assertron.js.map +1 -1
- package/esm/assertron/falsy.js +7 -4
- package/esm/assertron/falsy.js.map +1 -1
- package/esm/assertron/index.d.ts +3 -3
- package/esm/assertron/isInstanceof.js +8 -5
- package/esm/assertron/isInstanceof.js.map +1 -1
- package/esm/assertron/pathEqual.js +9 -6
- package/esm/assertron/pathEqual.js.map +1 -1
- package/esm/assertron/rejects.js +10 -6
- package/esm/assertron/rejects.js.map +1 -1
- package/esm/assertron/repeat.js +22 -25
- package/esm/assertron/repeat.js.map +1 -1
- package/esm/assertron/resolves.js +10 -6
- package/esm/assertron/resolves.js.map +1 -1
- package/esm/assertron/satisfies.d.ts +5 -10
- package/esm/assertron/satisfies.d.ts.map +1 -1
- package/esm/assertron/satisfies.js +14 -12
- package/esm/assertron/satisfies.js.map +1 -1
- package/esm/assertron/throws.js +47 -49
- package/esm/assertron/throws.js.map +1 -1
- package/esm/assertron/truthy.js +7 -4
- package/esm/assertron/truthy.js.map +1 -1
- package/esm/errors.d.ts +13 -10
- package/esm/errors.d.ts.map +1 -1
- package/esm/errors.js +20 -26
- package/esm/errors.js.map +1 -1
- package/esm/index.d.ts +10 -8
- package/esm/index.js +10 -7
- package/esm/index.js.map +1 -1
- package/esm/types.d.ts +5 -2
- package/esm/types.d.ts.map +1 -1
- package/esm/utils/index.js +13 -9
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/isErrorConstructor.js +6 -2
- package/esm/utils/isErrorConstructor.js.map +1 -1
- package/esm/utils/notEqualMessage.js +6 -2
- package/esm/utils/notEqualMessage.js.map +1 -1
- package/esm/utils/notSatisfiedMessage.js +15 -20
- package/esm/utils/notSatisfiedMessage.js.map +1 -1
- package/esm/utils/notThrownMessage.js +7 -3
- package/esm/utils/notThrownMessage.js.map +1 -1
- package/esm/utils/promiseMessages.js +9 -11
- package/esm/utils/promiseMessages.js.map +1 -1
- package/esm/utils/unexpectedErrorMessage.js +8 -4
- package/esm/utils/unexpectedErrorMessage.js.map +1 -1
- package/package.json +43 -68
- package/ts/assert-order/AssertOrder.ts +8 -6
- package/ts/assert-order/InvalidOrder.ts +4 -6
- package/ts/assert-order/StateMachine.ts +11 -7
- package/ts/assertron/assertron.ts +9 -19
- package/ts/assertron/falsy.ts +1 -2
- package/ts/assertron/isInstanceof.ts +1 -4
- package/ts/assertron/pathEqual.ts +1 -2
- package/ts/assertron/rejects.ts +2 -2
- package/ts/assertron/repeat.ts +5 -6
- package/ts/assertron/resolves.ts +3 -3
- package/ts/assertron/satisfies.ts +2 -4
- package/ts/assertron/throws.ts +14 -20
- package/ts/assertron/truthy.ts +1 -2
- package/ts/errors.ts +5 -1
- package/ts/index.ts +2 -2
- package/ts/utils/index.ts +1 -1
- package/ts/utils/notSatisfiedMessage.ts +2 -2
- package/ts/utils/promiseMessages.ts +5 -5
- package/cjs/assert-order/StateMachine.d.ts +0 -22
- package/cjs/assert-order/StateMachine.d.ts.map +0 -1
- package/cjs/assert-order/index.d.ts.map +0 -1
- package/cjs/assert-order/index.js +0 -20
- package/cjs/assert-order/index.js.map +0 -1
- package/cjs/assert-order/types.js +0 -3
- package/cjs/assert-order/types.js.map +0 -1
- package/cjs/assertron/falsy.d.ts +0 -2
- package/cjs/assertron/falsy.d.ts.map +0 -1
- package/cjs/assertron/index.d.ts.map +0 -1
- package/cjs/assertron/index.js +0 -18
- package/cjs/assertron/index.js.map +0 -1
- package/cjs/assertron/isInstanceof.d.ts +0 -3
- package/cjs/assertron/isInstanceof.d.ts.map +0 -1
- package/cjs/assertron/pathEqual.d.ts +0 -2
- package/cjs/assertron/pathEqual.d.ts.map +0 -1
- package/cjs/assertron/rejects.d.ts +0 -2
- package/cjs/assertron/rejects.d.ts.map +0 -1
- package/cjs/assertron/repeat.d.ts +0 -6
- package/cjs/assertron/repeat.d.ts.map +0 -1
- package/cjs/assertron/resolves.d.ts +0 -2
- package/cjs/assertron/resolves.d.ts.map +0 -1
- package/cjs/assertron/throws.d.ts +0 -6
- package/cjs/assertron/throws.d.ts.map +0 -1
- package/cjs/assertron/truthy.d.ts +0 -2
- package/cjs/assertron/truthy.d.ts.map +0 -1
- package/cjs/index.d.ts.map +0 -1
- package/cjs/types.js +0 -3
- package/cjs/types.js.map +0 -1
- package/cjs/utils/index.d.ts +0 -8
- package/cjs/utils/index.d.ts.map +0 -1
- package/cjs/utils/isErrorConstructor.d.ts +0 -3
- package/cjs/utils/isErrorConstructor.d.ts.map +0 -1
- package/cjs/utils/notEqualMessage.d.ts +0 -2
- package/cjs/utils/notEqualMessage.d.ts.map +0 -1
- package/cjs/utils/notSatisfiedMessage.d.ts +0 -3
- package/cjs/utils/notSatisfiedMessage.d.ts.map +0 -1
- package/cjs/utils/notThrownMessage.d.ts +0 -2
- package/cjs/utils/notThrownMessage.d.ts.map +0 -1
- package/cjs/utils/promiseMessages.d.ts +0 -3
- package/cjs/utils/promiseMessages.d.ts.map +0 -1
- package/cjs/utils/unexpectedErrorMessage.d.ts +0 -3
- package/cjs/utils/unexpectedErrorMessage.d.ts.map +0 -1
- package/esm/assert-order/StateMachine.d.ts +0 -22
- package/esm/assert-order/StateMachine.d.ts.map +0 -1
- package/esm/assert-order/index.d.ts.map +0 -1
- package/esm/assert-order/index.js +0 -4
- package/esm/assert-order/index.js.map +0 -1
- package/esm/assert-order/types.js +0 -2
- package/esm/assert-order/types.js.map +0 -1
- package/esm/assertron/falsy.d.ts +0 -2
- package/esm/assertron/falsy.d.ts.map +0 -1
- package/esm/assertron/index.d.ts.map +0 -1
- package/esm/assertron/index.js +0 -2
- package/esm/assertron/index.js.map +0 -1
- package/esm/assertron/isInstanceof.d.ts +0 -3
- package/esm/assertron/isInstanceof.d.ts.map +0 -1
- package/esm/assertron/pathEqual.d.ts +0 -2
- package/esm/assertron/pathEqual.d.ts.map +0 -1
- package/esm/assertron/rejects.d.ts +0 -2
- package/esm/assertron/rejects.d.ts.map +0 -1
- package/esm/assertron/repeat.d.ts +0 -6
- package/esm/assertron/repeat.d.ts.map +0 -1
- package/esm/assertron/resolves.d.ts +0 -2
- package/esm/assertron/resolves.d.ts.map +0 -1
- package/esm/assertron/throws.d.ts +0 -6
- package/esm/assertron/throws.d.ts.map +0 -1
- package/esm/assertron/truthy.d.ts +0 -2
- package/esm/assertron/truthy.d.ts.map +0 -1
- package/esm/index.d.ts.map +0 -1
- package/esm/types.js +0 -2
- package/esm/types.js.map +0 -1
- package/esm/utils/index.d.ts +0 -8
- package/esm/utils/index.d.ts.map +0 -1
- package/esm/utils/isErrorConstructor.d.ts +0 -3
- package/esm/utils/isErrorConstructor.d.ts.map +0 -1
- package/esm/utils/notEqualMessage.d.ts +0 -2
- package/esm/utils/notEqualMessage.d.ts.map +0 -1
- package/esm/utils/notSatisfiedMessage.d.ts +0 -3
- package/esm/utils/notSatisfiedMessage.d.ts.map +0 -1
- package/esm/utils/notThrownMessage.d.ts +0 -2
- package/esm/utils/notThrownMessage.d.ts.map +0 -1
- package/esm/utils/promiseMessages.d.ts +0 -3
- package/esm/utils/promiseMessages.d.ts.map +0 -1
- package/esm/utils/unexpectedErrorMessage.d.ts +0 -3
- package/esm/utils/unexpectedErrorMessage.d.ts.map +0 -1
- package/ts/assert-order/internalInterfaces.ts +0 -5
- package/ts/testUtils.ts +0 -81
package/cjs/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../ts/types.ts"],"mappings":";KAAY,kBAAkB;KAClB,iBAAiB,UAAU,iBAAiB,gBAAgB"}
|
package/cjs/utils/index.js
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.failOnOccurrence = void 0;
|
|
18
|
-
const tersify_1 = require("tersify");
|
|
19
|
-
__exportStar(require("./isErrorConstructor.js"), exports);
|
|
20
|
-
__exportStar(require("./notEqualMessage.js"), exports);
|
|
21
|
-
__exportStar(require("./notSatisfiedMessage.js"), exports);
|
|
22
|
-
__exportStar(require("./notThrownMessage.js"), exports);
|
|
23
|
-
__exportStar(require("./promiseMessages.js"), exports);
|
|
24
|
-
__exportStar(require("./unexpectedErrorMessage.js"), exports);
|
|
1
|
+
const require_isErrorConstructor = require("./isErrorConstructor.js");
|
|
2
|
+
const require_notEqualMessage = require("./notEqualMessage.js");
|
|
3
|
+
const require_notSatisfiedMessage = require("./notSatisfiedMessage.js");
|
|
4
|
+
const require_notThrownMessage = require("./notThrownMessage.js");
|
|
5
|
+
const require_promiseMessages = require("./promiseMessages.js");
|
|
6
|
+
const require_unexpectedErrorMessage = require("./unexpectedErrorMessage.js");
|
|
7
|
+
let tersify = require("tersify");
|
|
8
|
+
//#region ts/utils/index.ts
|
|
25
9
|
function failOnOccurrence(occurrence, error) {
|
|
26
|
-
|
|
10
|
+
return `Failed on ${occurrence} occurrence: ${(0, tersify.tersify)(error, { maxLength: Number.POSITIVE_INFINITY })}`;
|
|
27
11
|
}
|
|
12
|
+
//#endregion
|
|
28
13
|
exports.failOnOccurrence = failOnOccurrence;
|
|
14
|
+
exports.isErrorConstructor = require_isErrorConstructor.isErrorConstructor;
|
|
15
|
+
exports.notEqualMessage = require_notEqualMessage.notEqualMessage;
|
|
16
|
+
exports.notRejectedMessage = require_promiseMessages.notRejectedMessage;
|
|
17
|
+
exports.notResolvedMessage = require_promiseMessages.notResolvedMessage;
|
|
18
|
+
exports.notSatisfiedMessage = require_notSatisfiedMessage.notSatisfiedMessage;
|
|
19
|
+
exports.notThrownMessage = require_notThrownMessage.notThrownMessage;
|
|
20
|
+
exports.unexpectedErrorMessage = require_unexpectedErrorMessage.unexpectedErrorMessage;
|
|
21
|
+
|
|
29
22
|
//# sourceMappingURL=index.js.map
|
package/cjs/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../ts/utils/index.ts"],"sourcesContent":["import { tersify } from 'tersify'\n\nexport * from './isErrorConstructor.js'\nexport * from './notEqualMessage.js'\nexport * from './notSatisfiedMessage.js'\nexport * from './notThrownMessage.js'\nexport * from './promiseMessages.js'\nexport * from './unexpectedErrorMessage.js'\n\nexport function failOnOccurrence(occurrence: number, error: any) {\n\treturn `Failed on ${occurrence} occurrence: ${tersify(error, { maxLength: Number.POSITIVE_INFINITY })}`\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,iBAAiB,YAAoB,OAAY;CAChE,OAAO,aAAa,WAAW,gBAAA,GAAe,QAAA,QAAA,CAAQ,OAAO,EAAE,WAAW,OAAO,kBAAkB,CAAC;AACrG"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isErrorConstructor = void 0;
|
|
1
|
+
//#region ts/utils/isErrorConstructor.ts
|
|
4
2
|
function isErrorConstructor(validator) {
|
|
5
|
-
|
|
3
|
+
return Object.prototype.isPrototypeOf.call(Error.prototype, validator.prototype);
|
|
6
4
|
}
|
|
5
|
+
//#endregion
|
|
7
6
|
exports.isErrorConstructor = isErrorConstructor;
|
|
7
|
+
|
|
8
8
|
//# sourceMappingURL=isErrorConstructor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isErrorConstructor.js","
|
|
1
|
+
{"version":3,"file":"isErrorConstructor.js","names":[],"sources":["../../ts/utils/isErrorConstructor.ts"],"sourcesContent":["import type { ErrorConstructor } from '../types.js'\n\nexport function isErrorConstructor(validator: any): validator is ErrorConstructor<any> {\n\treturn Object.prototype.isPrototypeOf.call(Error.prototype, validator.prototype)\n}\n"],"mappings":";AAEA,SAAgB,mBAAmB,WAAoD;CACtF,OAAO,OAAO,UAAU,cAAc,KAAK,MAAM,WAAW,UAAU,SAAS;AAChF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.notEqualMessage = void 0;
|
|
1
|
+
//#region ts/utils/notEqualMessage.ts
|
|
4
2
|
function notEqualMessage(actual, expected) {
|
|
5
|
-
|
|
3
|
+
return `Expected value to equal ${expected}, but received ${actual}`;
|
|
6
4
|
}
|
|
5
|
+
//#endregion
|
|
7
6
|
exports.notEqualMessage = notEqualMessage;
|
|
7
|
+
|
|
8
8
|
//# sourceMappingURL=notEqualMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notEqualMessage.js","
|
|
1
|
+
{"version":3,"file":"notEqualMessage.js","names":[],"sources":["../../ts/utils/notEqualMessage.ts"],"sourcesContent":["export function notEqualMessage(actual: any, expected: any) {\n\treturn `Expected value to equal ${expected}, but received ${actual}`\n}\n"],"mappings":";AAAA,SAAgB,gBAAgB,QAAa,UAAe;CAC3D,OAAO,2BAA2B,SAAS,iBAAiB;AAC7D"}
|
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.notSatisfiedMessage = void 0;
|
|
4
|
-
const tersify_1 = require("tersify");
|
|
1
|
+
let tersify = require("tersify");
|
|
2
|
+
//#region ts/utils/notSatisfiedMessage.ts
|
|
5
3
|
function notSatisfiedMessage(entries) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return `Expect ${path} to satisfy ${formatValue(e.expected)}, but received ${formatValue(e.actual)}`;
|
|
10
|
-
})
|
|
11
|
-
.join('\n');
|
|
4
|
+
return entries.map((e) => {
|
|
5
|
+
return `Expect ${formatPath(e.path)} to satisfy ${formatValue(e.expected)}, but received ${formatValue(e.actual)}`;
|
|
6
|
+
}).join("\n");
|
|
12
7
|
}
|
|
13
|
-
exports.notSatisfiedMessage = notSatisfiedMessage;
|
|
14
8
|
function formatPath(entries) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
nodes.unshift('actual');
|
|
20
|
-
}
|
|
21
|
-
return nodes
|
|
22
|
-
.map(n => (isIndice(n) ? `[${n}]` : '.' + n))
|
|
23
|
-
.join('')
|
|
24
|
-
.slice(1);
|
|
9
|
+
if (entries.length === 0) return "actual";
|
|
10
|
+
const nodes = [...entries];
|
|
11
|
+
if (isIndice(nodes[0])) nodes.unshift("actual");
|
|
12
|
+
return nodes.map((n) => isIndice(n) ? `[${n}]` : "." + n).join("").slice(1);
|
|
25
13
|
}
|
|
26
14
|
function isIndice(node) {
|
|
27
|
-
|
|
15
|
+
return typeof node === "number";
|
|
28
16
|
}
|
|
29
17
|
function formatValue(value) {
|
|
30
|
-
|
|
18
|
+
return (0, tersify.tersify)(value);
|
|
31
19
|
}
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.notSatisfiedMessage = notSatisfiedMessage;
|
|
22
|
+
|
|
32
23
|
//# sourceMappingURL=notSatisfiedMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notSatisfiedMessage.js","
|
|
1
|
+
{"version":3,"file":"notSatisfiedMessage.js","names":[],"sources":["../../ts/utils/notSatisfiedMessage.ts"],"sourcesContent":["import type { Diff } from 'satisfier'\nimport { tersify } from 'tersify'\n\nexport function notSatisfiedMessage(entries: Diff[]) {\n\treturn entries\n\t\t.map((e) => {\n\t\t\tconst path = formatPath(e.path)\n\t\t\treturn `Expect ${path} to satisfy ${formatValue(e.expected)}, but received ${formatValue(e.actual)}`\n\t\t})\n\t\t.join('\\n')\n}\n\nfunction formatPath(entries: (string | number)[]) {\n\tif (entries.length === 0) return 'actual'\n\tconst nodes = [...entries]\n\tif (isIndice(nodes[0])) {\n\t\tnodes.unshift('actual')\n\t}\n\treturn nodes\n\t\t.map((n) => (isIndice(n) ? `[${n}]` : '.' + n))\n\t\t.join('')\n\t\t.slice(1)\n}\n\nfunction isIndice(node: string | number): node is number {\n\treturn typeof node === 'number'\n}\n\nfunction formatValue(value: any) {\n\treturn tersify(value)\n}\n"],"mappings":";;AAGA,SAAgB,oBAAoB,SAAiB;CACpD,OAAO,QACL,KAAK,MAAM;EAEX,OAAO,UADM,WAAW,EAAE,IACN,EAAE,cAAc,YAAY,EAAE,QAAQ,EAAE,iBAAiB,YAAY,EAAE,MAAM;CAClG,CAAC,CAAC,CACD,KAAK,IAAI;AACZ;AAEA,SAAS,WAAW,SAA8B;CACjD,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,MAAM,QAAQ,CAAC,GAAG,OAAO;CACzB,IAAI,SAAS,MAAM,EAAE,GACpB,MAAM,QAAQ,QAAQ;CAEvB,OAAO,MACL,KAAK,MAAO,SAAS,CAAC,IAAI,IAAI,EAAE,KAAK,MAAM,CAAE,CAAC,CAC9C,KAAK,EAAE,CAAC,CACR,MAAM,CAAC;AACV;AAEA,SAAS,SAAS,MAAuC;CACxD,OAAO,OAAO,SAAS;AACxB;AAEA,SAAS,YAAY,OAAY;CAChC,QAAA,GAAO,QAAA,QAAA,CAAQ,KAAK;AACrB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.notThrownMessage = void 0;
|
|
4
|
-
const tersify_1 = require("tersify");
|
|
1
|
+
let tersify = require("tersify");
|
|
2
|
+
//#region ts/utils/notThrownMessage.ts
|
|
5
3
|
function notThrownMessage(value) {
|
|
6
|
-
|
|
4
|
+
return `Expect function to throw, but it returned '${(0, tersify.tersify)(value)}' instead.`;
|
|
7
5
|
}
|
|
6
|
+
//#endregion
|
|
8
7
|
exports.notThrownMessage = notThrownMessage;
|
|
8
|
+
|
|
9
9
|
//# sourceMappingURL=notThrownMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notThrownMessage.js","
|
|
1
|
+
{"version":3,"file":"notThrownMessage.js","names":[],"sources":["../../ts/utils/notThrownMessage.ts"],"sourcesContent":["import { tersify } from 'tersify'\n\nexport function notThrownMessage(value: any) {\n\treturn `Expect function to throw, but it returned '${tersify(value)}' instead.`\n}\n"],"mappings":";;AAEA,SAAgB,iBAAiB,OAAY;CAC5C,OAAO,+CAAA,GAA8C,QAAA,QAAA,CAAQ,KAAK,EAAE;AACrE"}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.notResolvedMessage = exports.notRejectedMessage = void 0;
|
|
4
|
-
const tersify_1 = require("tersify");
|
|
1
|
+
let tersify = require("tersify");
|
|
2
|
+
//#region ts/utils/promiseMessages.ts
|
|
5
3
|
function notRejectedMessage(value) {
|
|
6
|
-
|
|
7
|
-
(typeof value === 'string' ? `'${value}'` : (0, tersify_1.tersify)(value, { maxLength: Infinity })));
|
|
4
|
+
return "Expected promise to reject, but it resolves with " + (typeof value === "string" ? `'${value}'` : (0, tersify.tersify)(value, { maxLength: Number.POSITIVE_INFINITY }));
|
|
8
5
|
}
|
|
9
|
-
exports.notRejectedMessage = notRejectedMessage;
|
|
10
6
|
function notResolvedMessage(error) {
|
|
11
|
-
|
|
12
|
-
(typeof error === 'string'
|
|
13
|
-
? `'${error}'`
|
|
14
|
-
: error instanceof Error
|
|
15
|
-
? error
|
|
16
|
-
: (0, tersify_1.tersify)(error, { maxLength: Infinity })));
|
|
7
|
+
return "Expected promise to resolve, but it rejects with " + (typeof error === "string" ? `'${error}'` : error instanceof Error ? error : (0, tersify.tersify)(error, { maxLength: Number.POSITIVE_INFINITY }));
|
|
17
8
|
}
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.notRejectedMessage = notRejectedMessage;
|
|
18
11
|
exports.notResolvedMessage = notResolvedMessage;
|
|
12
|
+
|
|
19
13
|
//# sourceMappingURL=promiseMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promiseMessages.js","
|
|
1
|
+
{"version":3,"file":"promiseMessages.js","names":[],"sources":["../../ts/utils/promiseMessages.ts"],"sourcesContent":["import { tersify } from 'tersify'\n\nexport function notRejectedMessage(value: any) {\n\treturn (\n\t\t'Expected promise to reject, but it resolves with ' +\n\t\t(typeof value === 'string' ? `'${value}'` : tersify(value, { maxLength: Number.POSITIVE_INFINITY }))\n\t)\n}\n\nexport function notResolvedMessage(error: any) {\n\treturn (\n\t\t'Expected promise to resolve, but it rejects with ' +\n\t\t(typeof error === 'string'\n\t\t\t? `'${error}'`\n\t\t\t: error instanceof Error\n\t\t\t\t? error\n\t\t\t\t: tersify(error, { maxLength: Number.POSITIVE_INFINITY }))\n\t)\n}\n"],"mappings":";;AAEA,SAAgB,mBAAmB,OAAY;CAC9C,OACC,uDACC,OAAO,UAAU,WAAW,IAAI,MAAM,MAAA,GAAK,QAAA,QAAA,CAAQ,OAAO,EAAE,WAAW,OAAO,kBAAkB,CAAC;AAEpG;AAEA,SAAgB,mBAAmB,OAAY;CAC9C,OACC,uDACC,OAAO,UAAU,WACf,IAAI,MAAM,KACV,iBAAiB,QAChB,SAAA,GACA,QAAA,QAAA,CAAQ,OAAO,EAAE,WAAW,OAAO,kBAAkB,CAAC;AAE5D"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tersify_1 = require("tersify");
|
|
5
|
-
const isErrorConstructor_js_1 = require("./isErrorConstructor.js");
|
|
1
|
+
const require_isErrorConstructor = require("./isErrorConstructor.js");
|
|
2
|
+
let tersify = require("tersify");
|
|
3
|
+
//#region ts/utils/unexpectedErrorMessage.ts
|
|
6
4
|
function unexpectedErrorMessage(actual, expected) {
|
|
7
|
-
|
|
5
|
+
return `Unexpected error. Expecting '${require_isErrorConstructor.isErrorConstructor(expected) ? expected.name : (0, tersify.tersify)(expected)}' but received ${(0, tersify.tersify)(actual)}`;
|
|
8
6
|
}
|
|
7
|
+
//#endregion
|
|
9
8
|
exports.unexpectedErrorMessage = unexpectedErrorMessage;
|
|
9
|
+
|
|
10
10
|
//# sourceMappingURL=unexpectedErrorMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unexpectedErrorMessage.js","
|
|
1
|
+
{"version":3,"file":"unexpectedErrorMessage.js","names":["isErrorConstructor"],"sources":["../../ts/utils/unexpectedErrorMessage.ts"],"sourcesContent":["import { tersify } from 'tersify'\nimport type { ErrorConstructor, ErrorValidator } from '../types.js'\nimport { isErrorConstructor } from './isErrorConstructor.js'\n\nexport function unexpectedErrorMessage(actual: any, expected: ErrorValidator | ErrorConstructor<any>) {\n\treturn `Unexpected error. Expecting '${\n\t\tisErrorConstructor(expected) ? expected.name : tersify(expected)\n\t}' but received ${tersify(actual)}`\n}\n"],"mappings":";;;AAIA,SAAgB,uBAAuB,QAAa,UAAkD;CACrG,OAAO,gCACNA,2BAAAA,mBAAmB,QAAQ,IAAI,SAAS,QAAA,GAAO,QAAA,QAAA,CAAQ,QAAQ,EAC/D,kBAAA,GAAiB,QAAA,QAAA,CAAQ,MAAM;AACjC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import toPropertyKey from "./toPropertyKey.js";
|
|
2
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/defineProperty.js
|
|
3
|
+
function _defineProperty(e, r, t) {
|
|
4
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
5
|
+
value: t,
|
|
6
|
+
enumerable: !0,
|
|
7
|
+
configurable: !0,
|
|
8
|
+
writable: !0
|
|
9
|
+
}) : e[r] = t, e;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { _defineProperty as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _typeof from "./typeof.js";
|
|
2
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/toPrimitive.js
|
|
3
|
+
function toPrimitive(t, r) {
|
|
4
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
5
|
+
var e = t[Symbol.toPrimitive];
|
|
6
|
+
if (void 0 !== e) {
|
|
7
|
+
var i = e.call(t, r || "default");
|
|
8
|
+
if ("object" != _typeof(i)) return i;
|
|
9
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
10
|
+
}
|
|
11
|
+
return ("string" === r ? String : Number)(t);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { toPrimitive as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _typeof from "./typeof.js";
|
|
2
|
+
import toPrimitive from "./toPrimitive.js";
|
|
3
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/toPropertyKey.js
|
|
4
|
+
function toPropertyKey(t) {
|
|
5
|
+
var i = toPrimitive(t, "string");
|
|
6
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { toPropertyKey as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/typeof.js
|
|
2
|
+
function _typeof(o) {
|
|
3
|
+
"@babel/helpers - typeof";
|
|
4
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
5
|
+
return typeof o;
|
|
6
|
+
} : function(o) {
|
|
7
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
8
|
+
}, _typeof(o);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { _typeof as default };
|
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
//#region ts/assert-order/AssertOrder.d.ts
|
|
2
|
+
declare class AssertOrder {
|
|
3
|
+
/**
|
|
4
|
+
* Gets the current expecting step.
|
|
5
|
+
*/
|
|
6
|
+
get currentStep(): number;
|
|
7
|
+
private state;
|
|
8
|
+
constructor(plan?: number);
|
|
9
|
+
/**
|
|
10
|
+
* Asserts the current step is `step`.
|
|
11
|
+
* @param step expected step.
|
|
12
|
+
*/
|
|
13
|
+
is(step: number): void;
|
|
14
|
+
/**
|
|
15
|
+
* Asserts the current step is not `step`.
|
|
16
|
+
* @param step not expected step.
|
|
17
|
+
*/
|
|
18
|
+
not(step: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* Reset to specified step.
|
|
21
|
+
*/
|
|
22
|
+
jump(step: number): void;
|
|
23
|
+
/**
|
|
24
|
+
* Move to next step.
|
|
25
|
+
*/
|
|
26
|
+
move(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Asserts the specified step will run once.
|
|
29
|
+
*/
|
|
30
|
+
once(step: number): void;
|
|
31
|
+
on(step: number, assert: (step: number) => void): void;
|
|
32
|
+
atLeastOnce(step: number): number;
|
|
33
|
+
any(steps: number[], handler?: (step: number) => void): number;
|
|
34
|
+
onAny(steps: number[], ...asserts: Array<(step: number) => unknown>): void;
|
|
35
|
+
end(timeout: number): Promise<number>;
|
|
36
|
+
end(): number;
|
|
37
|
+
exactly(step: number, times: number): number;
|
|
38
|
+
wait(step: number): Promise<void>;
|
|
39
|
+
wait(step: number, callback: () => void): void;
|
|
40
|
+
private assert;
|
|
40
41
|
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { AssertOrder };
|
|
41
44
|
//# sourceMappingURL=AssertOrder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssertOrder.d.ts","
|
|
1
|
+
{"version":3,"file":"AssertOrder.d.ts","names":[],"sources":["../../ts/assert-order/AssertOrder.ts"],"mappings":";cAMa;;;;MAIR;UAII;EACR,YAAY;;;;;EAQZ,GAAG;;;;;EAQH,IAAI;;;;EASJ,KAAK;;;;EAOL;;;;EAOA,KAAK;EAKL,GAAG,cAAc,SAAS;EAM1B,YAAY;EAYZ,IAAI,iBAAiB,WAAW;EAUhC,MAAM,oBAAoB,SAAS,OAAO;EAkB1C,IAAI,kBAAkB;EACtB;EAmBA,QAAQ,cAAc;EAWtB,KAAK,eAAe;EACpB,KAAK,cAAc;UAQX"}
|