@browsermation/test 0.0.50 → 0.0.52

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 CHANGED
@@ -42258,7 +42258,7 @@ var {
42258
42258
  // package.json
42259
42259
  var package_default = {
42260
42260
  name: "@browsermation/test",
42261
- version: "0.0.50",
42261
+ version: "0.0.52",
42262
42262
  description: "The testing platform for Playwright by Browsermation.",
42263
42263
  main: "./dist/index.js",
42264
42264
  types: "./dist/index.d.ts",
@@ -46661,6 +46661,14 @@ function startTunnel(tunnelProcess, options) {
46661
46661
  );
46662
46662
  process.exit(1);
46663
46663
  }
46664
+ if (!options?.port) {
46665
+ console.error(
46666
+ source_default.red.bold(
46667
+ "\u274C Error: Please provide a port to expose via the tunnel using the --tunnel or --port option."
46668
+ )
46669
+ );
46670
+ process.exit(1);
46671
+ }
46664
46672
  const tunnelDomain = `${options.subdomain || crypto.randomUUID()}.browsermationtunnel.com`;
46665
46673
  tunnelProcess = (0, import_node_child_process.spawn)("ssh", [
46666
46674
  "-o",
@@ -46668,7 +46676,7 @@ function startTunnel(tunnelProcess, options) {
46668
46676
  "-o",
46669
46677
  "UserKnownHostsFile=/dev/null",
46670
46678
  "-R",
46671
- `:80:localhost:${options.tunnel}`,
46679
+ `:80:localhost:${options.port}`,
46672
46680
  "v0@browsermationtunnel.com",
46673
46681
  "-p",
46674
46682
  "2200",
@@ -46742,7 +46750,12 @@ async function downloadFile(fileUrl, outputLocationPath) {
46742
46750
 
46743
46751
  // src/bin/cli.ts
46744
46752
  var program2 = new Command().name("browsermation").version(package_default.version).description(package_default.description);
46745
- program2.command("test").argument("<folder>", "The path to the folder to zip and upload").argument("<totalShards>", "Total number of shards").option("-t, --tunnel <port>").option("-p, --proxy").option("--project <project>", "Run a specific project").option(
46753
+ program2.command("tunnel").option("-p, --port <port>").action(async (options) => {
46754
+ console.log(source_default.blue(`\u{1F680} Starting BrowserMation Tunnel...`));
46755
+ let tunnelProcess = null;
46756
+ await startTunnel(tunnelProcess, options);
46757
+ });
46758
+ program2.command("test").option("-t, --tunnel <port>").option("-p, --proxy").option("--project <project>", "Run a specific project").option(
46746
46759
  "-s, --subdomain <subdomain>",
46747
46760
  "Use subdomain <subdomain> for BrowserMation tunnel"
46748
46761
  ).action(async (folder, totalShards, options) => {
@@ -46754,7 +46767,9 @@ program2.command("test").argument("<folder>", "The path to the folder to zip and
46754
46767
  proxy: false
46755
46768
  };
46756
46769
  if (options.tunnel) {
46757
- const startTunnelResult = await startTunnel(tunnelProcess, options);
46770
+ const startTunnelResult = await startTunnel(tunnelProcess, {
46771
+ port: options.tunnel
46772
+ });
46758
46773
  tunnelProcess = startTunnelResult.tunnelProcess;
46759
46774
  }
46760
46775
  if (options.proxy) {
package/dist/index.js CHANGED
@@ -545,6 +545,14 @@ function startTunnel(tunnelProcess2, options) {
545
545
  );
546
546
  process.exit(1);
547
547
  }
548
+ if (!options?.port) {
549
+ console.error(
550
+ source_default.red.bold(
551
+ "\u274C Error: Please provide a port to expose via the tunnel using the --tunnel or --port option."
552
+ )
553
+ );
554
+ process.exit(1);
555
+ }
548
556
  const tunnelDomain = `${options.subdomain || crypto.randomUUID()}.browsermationtunnel.com`;
549
557
  tunnelProcess2 = (0, import_node_child_process.spawn)("ssh", [
550
558
  "-o",
@@ -552,7 +560,7 @@ function startTunnel(tunnelProcess2, options) {
552
560
  "-o",
553
561
  "UserKnownHostsFile=/dev/null",
554
562
  "-R",
555
- `:80:localhost:${options.tunnel}`,
563
+ `:80:localhost:${options.port}`,
556
564
  "v0@browsermationtunnel.com",
557
565
  "-p",
558
566
  "2200",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browsermation/test",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
4
4
  "description": "The testing platform for Playwright by Browsermation.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",