@browsermation/test 0.0.55 → 0.0.61

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/README.md CHANGED
@@ -12,12 +12,6 @@ npm install @browsermation/test
12
12
 
13
13
  See also [Browsermation](https://www.npmjs.com/package/@browsermation/test) for the test package.
14
14
 
15
- You can use via the CLI
16
-
17
- ```bash
18
- npx @browsermation/test test
19
- ```
20
-
21
15
  Or use it as Playwright reporter
22
16
 
23
17
  ```bash
package/dist/index.js CHANGED
@@ -230,8 +230,8 @@ var import_node_process = __toESM(require("node:process"), 1);
230
230
  var import_node_os = __toESM(require("node:os"), 1);
231
231
  var import_node_tty = __toESM(require("node:tty"), 1);
232
232
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
233
- const prefix2 = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
234
- const position = argv.indexOf(prefix2 + flag);
233
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
234
+ const position = argv.indexOf(prefix + flag);
235
235
  const terminatorPosition = argv.indexOf("--");
236
236
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
237
237
  }
@@ -374,12 +374,12 @@ function stringReplaceAll(string, substring, replacer) {
374
374
  returnValue += string.slice(endIndex);
375
375
  return returnValue;
376
376
  }
377
- function stringEncaseCRLFWithFirstIndex(string, prefix2, postfix, index) {
377
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
378
378
  let endIndex = 0;
379
379
  let returnValue = "";
380
380
  do {
381
381
  const gotCR = string[index - 1] === "\r";
382
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix2 + (gotCR ? "\r\n" : "\n") + postfix;
382
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
383
383
  endIndex = index + 1;
384
384
  index = string.indexOf("\n", endIndex);
385
385
  } while (index !== -1);
@@ -692,34 +692,25 @@ var import_test = __toESM(require("playwright/test"), 1);
692
692
 
693
693
  // src/test.ts
694
694
  var import_node_https2 = __toESM(require("node:https"));
695
-
696
- // node_modules/tiny-invariant/dist/esm/tiny-invariant.js
697
- var isProduction = process.env.NODE_ENV === "production";
698
- var prefix = "Invariant failed";
699
- function invariant(condition, message) {
700
- if (condition) {
701
- return;
702
- }
703
- if (isProduction) {
704
- throw new Error(prefix);
705
- }
706
- var provided = typeof message === "function" ? message() : message;
707
- var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
708
- throw new Error(value);
709
- }
710
-
711
- // src/test.ts
712
695
  async function fetchEndpoint2() {
713
- invariant(
714
- process.env.SERVER_URL,
715
- "SERVER_URL environment variable is not set"
716
- );
717
- invariant(
718
- process.env.BM_API_TOKEN,
719
- "BM_API_TOKEN environment variable is not set"
720
- );
696
+ if (!process.env.SERVER_URL) {
697
+ console.error(
698
+ source_default.red.bold(
699
+ "\u274C Error: SERVER_URL environment variable is not set. Please set it to your server URL."
700
+ )
701
+ );
702
+ process.exit(1);
703
+ }
704
+ if (!process.env.BM_API_TOKEN) {
705
+ console.error(
706
+ source_default.red.bold(
707
+ "\u274C Error: BM_API_TOKEN environment variable is not set. Please set it to your API token."
708
+ )
709
+ );
710
+ process.exit(1);
711
+ }
721
712
  return new Promise((resolve, reject) => {
722
- import_node_https2.default.get(process.env.SERVER_URL, (res) => {
713
+ import_node_https2.default.get(process.env.BM_SERVER_URL, (res) => {
723
714
  res.on("data", (chunk) => {
724
715
  const parsedData = JSON.parse(chunk.toString());
725
716
  if (parsedData.type === "tunnel-domain") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browsermation/test",
3
- "version": "0.0.55",
3
+ "version": "0.0.61",
4
4
  "description": "The testing platform for Playwright by Browsermation.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -26,11 +26,10 @@
26
26
  "dist"
27
27
  ],
28
28
  "scripts": {
29
- "build:cli": "esbuild src/bin/cli.ts --bundle --platform=node --external:playwright --target=node22 --outfile=dist/bin/cli.js",
30
29
  "build:reporter": "esbuild src/reporter/reporter.ts --bundle --platform=node --external:playwright --target=node22 --outfile=dist/reporter.js",
31
30
  "build:index": "esbuild src/index.ts --bundle --platform=node --external:playwright --target=node22 --outfile=dist/index.js",
32
31
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
33
- "build": "rm -rf dist && npm run build:cli && npm run build:index && npm run build:reporter && npm run build:types",
32
+ "build": "rm -rf dist && npm run build:index && npm run build:reporter && npm run build:types",
34
33
  "start": "node dist/bin/cli.js",
35
34
  "build:start": "npm run build && npm start",
36
35
  "publishPackage": "npm run build && npm publish --access public"
@@ -44,25 +43,14 @@
44
43
  "author": "Browsermation Team",
45
44
  "license": "MIT",
46
45
  "devDependencies": {
47
- "@types/archiver": "^6.0.3",
48
46
  "@types/node": "^24.0.13",
49
47
  "esbuild": "^0.25.6",
50
48
  "typescript": "^5.9.2"
51
49
  },
52
50
  "dependencies": {
53
- "@browsermation/test": "^0.0.36",
54
51
  "@playwright/test": "^1.55.0",
55
- "archiver": "^7.0.1",
56
- "axios": "^1.10.0",
57
52
  "chalk": "^5.4.1",
58
- "commander": "^14.0.0",
59
- "form-data": "^4.0.3",
60
53
  "ora": "^8.2.0",
61
- "tiny-invariant": "^1.3.3",
62
- "ts-morph": "^26.0.0",
63
54
  "ts-node": "^10.9.2"
64
- },
65
- "peerDependencies": {
66
- "playwright": "^1.40.0"
67
55
  }
68
56
  }
package/dist/bin/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};