@browsermation/test 0.0.41 → 0.0.42
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/dist/bin/cli.js +4 -4
- package/dist/index.js +7 -10
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -42258,7 +42258,7 @@ var {
|
|
|
42258
42258
|
// package.json
|
|
42259
42259
|
var package_default = {
|
|
42260
42260
|
name: "@browsermation/test",
|
|
42261
|
-
version: "0.0.
|
|
42261
|
+
version: "0.0.42",
|
|
42262
42262
|
description: "The testing platform for Playwright by Browsermation.",
|
|
42263
42263
|
main: "./dist/index.js",
|
|
42264
42264
|
types: "./dist/index.d.ts",
|
|
@@ -46653,10 +46653,10 @@ async function upload(zipBuffer, shardNumber, totalShards, playwrightConfig, opt
|
|
|
46653
46653
|
// src/tunnel.ts
|
|
46654
46654
|
var import_node_child_process = require("node:child_process");
|
|
46655
46655
|
function startTunnel(tunnelProcess, options) {
|
|
46656
|
-
if (!process.env.
|
|
46656
|
+
if (!process.env.BM_TUNNEL_TOKEN) {
|
|
46657
46657
|
console.error(
|
|
46658
46658
|
source_default.red.bold(
|
|
46659
|
-
"\u274C Error:
|
|
46659
|
+
"\u274C Error: BM_TUNNEL_TOKEN environment variable is not set. Please set it to your tunnel token."
|
|
46660
46660
|
)
|
|
46661
46661
|
);
|
|
46662
46662
|
process.exit(1);
|
|
@@ -46678,7 +46678,7 @@ function startTunnel(tunnelProcess, options) {
|
|
|
46678
46678
|
"--custom_domain",
|
|
46679
46679
|
tunnelDomain,
|
|
46680
46680
|
"--token",
|
|
46681
|
-
process.env.
|
|
46681
|
+
process.env.BM_TUNNEL_TOKEN || ""
|
|
46682
46682
|
]);
|
|
46683
46683
|
process.on("SIGINT", function() {
|
|
46684
46684
|
console.log("\nGracefully shutting down from SIGINT (Ctrl+C)");
|
package/dist/index.js
CHANGED
|
@@ -537,10 +537,10 @@ var source_default = chalk;
|
|
|
537
537
|
// src/tunnel.ts
|
|
538
538
|
var import_node_child_process = require("node:child_process");
|
|
539
539
|
function startTunnel(tunnelProcess2, options) {
|
|
540
|
-
if (!process.env.
|
|
540
|
+
if (!process.env.BM_TUNNEL_TOKEN) {
|
|
541
541
|
console.error(
|
|
542
542
|
source_default.red.bold(
|
|
543
|
-
"\u274C Error:
|
|
543
|
+
"\u274C Error: BM_TUNNEL_TOKEN environment variable is not set. Please set it to your tunnel token."
|
|
544
544
|
)
|
|
545
545
|
);
|
|
546
546
|
process.exit(1);
|
|
@@ -562,7 +562,7 @@ function startTunnel(tunnelProcess2, options) {
|
|
|
562
562
|
"--custom_domain",
|
|
563
563
|
tunnelDomain,
|
|
564
564
|
"--token",
|
|
565
|
-
process.env.
|
|
565
|
+
process.env.BM_TUNNEL_TOKEN || ""
|
|
566
566
|
]);
|
|
567
567
|
process.on("SIGINT", function() {
|
|
568
568
|
console.log("\nGracefully shutting down from SIGINT (Ctrl+C)");
|
|
@@ -620,11 +620,6 @@ async function fetchEndpoint() {
|
|
|
620
620
|
if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400) {
|
|
621
621
|
const redirectUrl = res.headers.location;
|
|
622
622
|
if (redirectUrl) {
|
|
623
|
-
console.log(
|
|
624
|
-
source_default.yellow.bold(
|
|
625
|
-
`\u{1F500} Redirected to ${redirectUrl}, fetching WebSocket endpoint from there...`
|
|
626
|
-
)
|
|
627
|
-
);
|
|
628
623
|
resolve(redirectUrl);
|
|
629
624
|
}
|
|
630
625
|
}
|
|
@@ -642,15 +637,17 @@ async function defineConfig(config) {
|
|
|
642
637
|
`\u2705 WebSocket endpoint fetched successfully: ${endpointUrl}`
|
|
643
638
|
)
|
|
644
639
|
);
|
|
640
|
+
let tunnelUrl = void 0;
|
|
645
641
|
if (config.webServer && (Array.isArray(config.webServer) ? config.webServer.some((server) => server.port) : config.webServer.port)) {
|
|
646
|
-
await startTunnel(tunnelProcess, {
|
|
642
|
+
({ tunnelUrl } = await startTunnel(tunnelProcess, {
|
|
647
643
|
tunnel: Array.isArray(config.webServer) ? config.webServer.find((server) => server.port)?.port : config.webServer.port
|
|
648
|
-
});
|
|
644
|
+
}));
|
|
649
645
|
}
|
|
650
646
|
return {
|
|
651
647
|
...config,
|
|
652
648
|
use: {
|
|
653
649
|
...config.use,
|
|
650
|
+
baseURL: tunnelUrl,
|
|
654
651
|
connectOptions: {
|
|
655
652
|
wsEndpoint: endpointUrl
|
|
656
653
|
}
|