@rcompat/test 0.1.16 → 0.2.1
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/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/package.json +5 -5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rcompat/test",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
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.
|
|
18
|
+
"@rcompat/fs": "^0.13.2"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@rcompat/record": "^0.
|
|
21
|
+
"@rcompat/record": "^0.8.0"
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"imports": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "npm run clean && tsc",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
54
|
+
"test": "npm run build && npx proby",
|
|
55
|
+
"clean": "rm -rf ./lib"
|
|
56
56
|
}
|
|
57
57
|
}
|