@rcompat/test 0.2.0 → 0.3.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/lib/private/Body.d.ts +2 -1
- package/lib/private/Test.d.ts +1 -1
- package/lib/private/Test.js +3 -2
- package/lib/private/any.d.ts +2 -0
- package/lib/private/any.js +5 -0
- package/lib/private/equals.js +1 -1
- package/lib/private/repository.d.ts +1 -1
- package/lib/private/repository.js +2 -3
- package/lib/private/types/record.d.ts +5 -5
- package/lib/private/types/scalar.js +8 -1
- package/lib/private/undef.js +2 -2
- package/lib/public/any.d.ts +2 -0
- package/lib/public/any.js +2 -0
- package/package.json +3 -3
- package/lib/private/never.d.ts +0 -3
- package/lib/private/never.js +0 -3
- package/lib/public/never.d.ts +0 -2
- package/lib/public/never.js +0 -2
package/lib/private/Body.d.ts
CHANGED
package/lib/private/Test.d.ts
CHANGED
package/lib/private/Test.js
CHANGED
|
@@ -22,9 +22,10 @@ export default class Test {
|
|
|
22
22
|
report(actual, expected, passed) {
|
|
23
23
|
this.#results.push(new Result(actual, expected, passed));
|
|
24
24
|
}
|
|
25
|
-
run() {
|
|
25
|
+
async run() {
|
|
26
26
|
const asserter = (actual) => new Assert(this, actual);
|
|
27
|
-
this.#body(asserter);
|
|
27
|
+
await this.#body(asserter);
|
|
28
|
+
return this;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
;
|
package/lib/private/equals.js
CHANGED
|
@@ -16,7 +16,7 @@ const checks = [
|
|
|
16
16
|
[fn.is, (x, y) => fn.is(y) && fn.equal(x, y)],
|
|
17
17
|
[record.is, (x, y) => record.is(y)
|
|
18
18
|
&& record.equal(x, y)],
|
|
19
|
-
[(_) => true, (_, _1) => false]
|
|
19
|
+
[(_) => true, (_, _1) => false],
|
|
20
20
|
];
|
|
21
21
|
const equals = (x, y) => typeof x === typeof y
|
|
22
22
|
? checks.find(([predicate]) => predicate(x))[1](x, y)
|
|
@@ -6,7 +6,7 @@ declare class Repository {
|
|
|
6
6
|
reset(): void;
|
|
7
7
|
put(name: string, body: Body): void;
|
|
8
8
|
current(file: FileRef): void;
|
|
9
|
-
run():
|
|
9
|
+
run(): AsyncGenerator<Test, void, unknown>;
|
|
10
10
|
}
|
|
11
11
|
declare const _default: Repository;
|
|
12
12
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type Dict from "@rcompat/type/Dict";
|
|
2
2
|
declare const _default: {
|
|
3
|
-
equal: <T extends
|
|
4
|
-
include: <T extends
|
|
5
|
-
is: (x: unknown) => x is
|
|
6
|
-
partial: <t extends
|
|
3
|
+
equal: <T extends Dict>(x: T, y: T) => boolean;
|
|
4
|
+
include: <T extends Dict>(x: T, y: T) => boolean;
|
|
5
|
+
is: (x: unknown) => x is Dict;
|
|
6
|
+
partial: <t extends Dict>(x: t, y: t) => boolean;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
|
9
9
|
//# sourceMappingURL=record.d.ts.map
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
const scalars = [
|
|
1
|
+
const scalars = [
|
|
2
|
+
"bigint",
|
|
3
|
+
"boolean",
|
|
4
|
+
"number",
|
|
5
|
+
"string",
|
|
6
|
+
"symbol",
|
|
7
|
+
"undefined",
|
|
8
|
+
];
|
|
2
9
|
const is = (x) => scalars.includes(typeof x);
|
|
3
10
|
const equal = (x, y) => x === y || Object.is(x, y);
|
|
4
11
|
const include = equal;
|
package/lib/private/undef.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default
|
|
1
|
+
import any from "#any";
|
|
2
|
+
export default any(undefined);
|
|
3
3
|
//# sourceMappingURL=undef.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rcompat/test",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Standard library testing",
|
|
5
5
|
"bugs": "https://github.com/rcompat/rcompat/issues",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"directory": "packages/test"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@rcompat/fs": "^0.13.
|
|
18
|
+
"@rcompat/fs": "^0.13.2"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@rcompat/record": "^0.8.
|
|
21
|
+
"@rcompat/record": "^0.8.1"
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"imports": {
|
package/lib/private/never.d.ts
DELETED
package/lib/private/never.js
DELETED
package/lib/public/never.d.ts
DELETED
package/lib/public/never.js
DELETED