browser-ava 2.2.4 → 2.2.6
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/package.json +6 -6
- package/src/browser-ava-cli.mjs +15 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browser-ava",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -38,23 +38,23 @@
|
|
|
38
38
|
"@koa/cors": "^5.0.0",
|
|
39
39
|
"chalk": "^5.3.0",
|
|
40
40
|
"commander": "^12.0.0",
|
|
41
|
-
"es-module-lexer": "^1.
|
|
41
|
+
"es-module-lexer": "^1.5.0",
|
|
42
42
|
"globby": "^14.0.1",
|
|
43
|
-
"koa": "^2.15.
|
|
43
|
+
"koa": "^2.15.2",
|
|
44
44
|
"koa-static": "^5.0.0",
|
|
45
45
|
"playwright": "^1.42.1",
|
|
46
46
|
"ws": "^8.16.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/node": "^20.11.
|
|
49
|
+
"@types/node": "^20.11.30",
|
|
50
50
|
"ava": "^6.1.2",
|
|
51
51
|
"c8": "^9.1.0",
|
|
52
52
|
"documentation": "^14.0.3",
|
|
53
53
|
"execa": "^8.0.1",
|
|
54
|
-
"semantic-release": "^23.0.
|
|
54
|
+
"semantic-release": "^23.0.6"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
|
-
"node": ">=20.
|
|
57
|
+
"node": ">=20.12.0",
|
|
58
58
|
"bun": ">=1.0"
|
|
59
59
|
},
|
|
60
60
|
"repository": {
|
package/src/browser-ava-cli.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
1
|
+
#!/usr/bin/env -S node --no-warnings --title browser-ava
|
|
3
2
|
import { readFile } from "node:fs/promises";
|
|
4
3
|
import { resolve } from "node:path";
|
|
5
4
|
import { init, parse } from "es-module-lexer";
|
|
@@ -13,13 +12,7 @@ import { calculateSummary, summaryMessages } from "./browser/util.mjs";
|
|
|
13
12
|
import { resolveImport, utf8EncodingOptions } from "./resolver.mjs";
|
|
14
13
|
import { globby } from "globby";
|
|
15
14
|
import chalk from "chalk";
|
|
16
|
-
|
|
17
|
-
const { version, description } = JSON.parse(
|
|
18
|
-
readFileSync(
|
|
19
|
-
new URL("../package.json", import.meta.url).pathname,
|
|
20
|
-
utf8EncodingOptions
|
|
21
|
-
)
|
|
22
|
-
);
|
|
15
|
+
import pkg from "../package.json" assert { type: "json" };
|
|
23
16
|
|
|
24
17
|
const knownBrowsers = {
|
|
25
18
|
chrome: chromium,
|
|
@@ -39,20 +32,28 @@ Object.entries(knownBrowsers).forEach(([name, browser]) => {
|
|
|
39
32
|
});
|
|
40
33
|
|
|
41
34
|
program
|
|
42
|
-
.description(description)
|
|
43
|
-
.version(version)
|
|
35
|
+
.description(pkg.description)
|
|
36
|
+
.version(pkg.version)
|
|
44
37
|
.addOption(
|
|
45
38
|
new Option("-p, --port <number>", "server port to use")
|
|
46
39
|
.default(8080)
|
|
47
40
|
.env("PORT")
|
|
48
41
|
)
|
|
49
42
|
.addOption(
|
|
50
|
-
new Option(
|
|
43
|
+
new Option(
|
|
44
|
+
"-b, --browser <name>[,secondBrowserName]",
|
|
45
|
+
"browsers to use"
|
|
46
|
+
).env("BROWSER")
|
|
51
47
|
)
|
|
52
48
|
.option("--headless", "hide browser window", false)
|
|
49
|
+
.option(
|
|
50
|
+
"--keep-open",
|
|
51
|
+
"keep browser-ava and the browser open after execution",
|
|
52
|
+
true
|
|
53
|
+
)
|
|
53
54
|
.option(
|
|
54
55
|
"--no-keep-open",
|
|
55
|
-
"
|
|
56
|
+
"close browser-ava and the browsers after execution",
|
|
56
57
|
true
|
|
57
58
|
)
|
|
58
59
|
.argument("<tests...>")
|
|
@@ -207,7 +208,7 @@ async function loadAndRewriteImports(file) {
|
|
|
207
208
|
|
|
208
209
|
d += m.length - i.n.length;
|
|
209
210
|
} else {
|
|
210
|
-
console.warn(
|
|
211
|
+
console.warn(`${file}: Unable to resolve "${i.n}" may lead to import errors`);
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
return body;
|