proby 0.16.0 → 0.16.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/run.js +10 -3
- package/package.json +6 -6
package/lib/run.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import assert from "@rcompat/assert";
|
|
2
2
|
import color from "@rcompat/cli/color";
|
|
3
3
|
import print from "@rcompat/cli/print";
|
|
4
|
+
import fs from "@rcompat/fs";
|
|
4
5
|
import repository from "@rcompat/test/repository";
|
|
5
6
|
import { Worker } from "node:worker_threads";
|
|
6
7
|
const extensions = [".spec.ts", ".spec.js"];
|
|
@@ -74,17 +75,23 @@ async function run_in_worker(spec, env) {
|
|
|
74
75
|
});
|
|
75
76
|
}
|
|
76
77
|
export default async (root, subrepo, target, group) => {
|
|
78
|
+
const resolved = target === undefined ? undefined : fs.resolve(target).path;
|
|
77
79
|
const files = await root.list({
|
|
78
80
|
recursive: true,
|
|
79
|
-
filter: info =>
|
|
81
|
+
filter: info => {
|
|
82
|
+
const path = info.path;
|
|
83
|
+
if (resolved === undefined)
|
|
84
|
+
return extensions.some(e => path.endsWith(e));
|
|
85
|
+
if (extensions.some(e => resolved.endsWith(e)))
|
|
86
|
+
return path.endsWith(resolved);
|
|
87
|
+
return info.path.startsWith(resolved) && extensions.some(e => path.endsWith(e));
|
|
88
|
+
},
|
|
80
89
|
});
|
|
81
90
|
if (files.length === 0)
|
|
82
91
|
return;
|
|
83
92
|
if (subrepo !== undefined)
|
|
84
93
|
print(`${color.blue(subrepo)}\n`);
|
|
85
94
|
for (const file of files) {
|
|
86
|
-
if (target !== undefined && !file.path.endsWith(target))
|
|
87
|
-
continue;
|
|
88
95
|
const env_file = await file.sibling(file.name.replace(/\.spec\.(ts|js)$/, ".env.ts")).or(() => null);
|
|
89
96
|
if (env_file !== null) {
|
|
90
97
|
await run_in_worker(file, env_file);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proby",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "Standard library test runner",
|
|
5
5
|
"bugs": "https://github.com/rcompat/rcompat/issues",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@rcompat/assert": "^0.11.0",
|
|
20
|
+
"@rcompat/cli": "^0.21.0",
|
|
20
21
|
"@rcompat/env": "^0.20.0",
|
|
21
22
|
"@rcompat/fs": "^0.31.0",
|
|
22
|
-
"@rcompat/
|
|
23
|
-
"@rcompat/
|
|
24
|
-
"@rcompat/
|
|
25
|
-
"@rcompat/io": "^0.8.0"
|
|
23
|
+
"@rcompat/io": "^0.8.0",
|
|
24
|
+
"@rcompat/runtime": "^0.14.2",
|
|
25
|
+
"@rcompat/is": "^0.9.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@rcompat/type": "^0.15.
|
|
28
|
+
"@rcompat/type": "^0.15.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@rcompat/test": "^0.15.0"
|