@browsermation/test 0.0.33 → 0.0.34
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 +1 -1
- package/dist/index.js +6 -1
- 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.34",
|
|
42262
42262
|
description: "The testing platform for Playwright by Browsermation.",
|
|
42263
42263
|
main: "./dist/index.js",
|
|
42264
42264
|
types: "./dist/index.d.ts",
|
package/dist/index.js
CHANGED
|
@@ -612,13 +612,18 @@ async function fetchEndpoint() {
|
|
|
612
612
|
}
|
|
613
613
|
};
|
|
614
614
|
protocol.get(process.env.BM_SERVER_URL || "", options, (res) => {
|
|
615
|
+
if (res.statusCode && (res.statusCode < 200 || res.statusCode >= 400)) {
|
|
616
|
+
return reject(new Error(`HTTP status code ${res.statusCode} received`));
|
|
617
|
+
}
|
|
615
618
|
res.on("error", (err) => {
|
|
619
|
+
console.error(
|
|
620
|
+
source_default.red.bold("\u274C Error: Failed to fetch WebSocket endpoint.")
|
|
621
|
+
);
|
|
616
622
|
reject(err);
|
|
617
623
|
});
|
|
618
624
|
res.on("data", async (chunk) => {
|
|
619
625
|
try {
|
|
620
626
|
const parsedData = JSON.parse(chunk.toString());
|
|
621
|
-
console.log("Received data:", parsedData);
|
|
622
627
|
if (parsedData.type === "ws-endpoint") {
|
|
623
628
|
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
624
629
|
resolve(parsedData.wsEndpoint);
|