@browsermation/test 0.0.63-beta.4 → 0.0.63-beta.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/dist/reporter.js +11 -1
- package/package.json +1 -1
package/dist/reporter.js
CHANGED
|
@@ -47,6 +47,11 @@ var BrowsermationReporter = class {
|
|
|
47
47
|
this.log(
|
|
48
48
|
"Using API Token: " + (this.apiToken ? this.apiToken.slice(0, 4) + "****" : "not set")
|
|
49
49
|
);
|
|
50
|
+
if (!this.apiToken) {
|
|
51
|
+
console.warn(
|
|
52
|
+
"Warning: No API token set for Browsermation Reporter. Set BM_API_TOKEN environment variable or pass apiToken in reporter options."
|
|
53
|
+
);
|
|
54
|
+
}
|
|
50
55
|
}
|
|
51
56
|
async getCurrentBranch() {
|
|
52
57
|
return new Promise((resolve) => {
|
|
@@ -76,6 +81,10 @@ var BrowsermationReporter = class {
|
|
|
76
81
|
});
|
|
77
82
|
}
|
|
78
83
|
async sendData(data) {
|
|
84
|
+
if (!this.apiToken) {
|
|
85
|
+
this.log("API token not set. Skipping sending data to Browsermation.");
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
79
88
|
this.log(`Sending data to Browsermation: ${JSON.stringify(data)}`);
|
|
80
89
|
try {
|
|
81
90
|
const response = await fetch(this.browsermationURL, {
|
|
@@ -139,7 +148,8 @@ var BrowsermationReporter = class {
|
|
|
139
148
|
file: test.location.file,
|
|
140
149
|
timestamp: Date.now(),
|
|
141
150
|
free_memory: (0, import_node_os.freemem)(),
|
|
142
|
-
total_memory: (0, import_node_os.totalmem)()
|
|
151
|
+
total_memory: (0, import_node_os.totalmem)(),
|
|
152
|
+
project: test.parent.project.name
|
|
143
153
|
};
|
|
144
154
|
this.log(`${JSON.stringify(data)}
|
|
145
155
|
`);
|