browser-ava 1.0.4 → 1.2.0
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/package.json +1 -1
- package/src/browser/runtime.mjs +3 -0
- package/src/browser-ava-cli.mjs +19 -1
package/package.json
CHANGED
package/src/browser/runtime.mjs
CHANGED
package/src/browser-ava-cli.mjs
CHANGED
|
@@ -58,6 +58,13 @@ program
|
|
|
58
58
|
.argument("<tests...>")
|
|
59
59
|
.action(async (tests, options) => {
|
|
60
60
|
if (options.browser) {
|
|
61
|
+
const parts = options.browser.split(/:/);
|
|
62
|
+
if (parts.length > 1) {
|
|
63
|
+
if (parts[1] === "headless") {
|
|
64
|
+
options.headless = true;
|
|
65
|
+
}
|
|
66
|
+
options.browser = parts[0];
|
|
67
|
+
}
|
|
61
68
|
browsers.push(knownBrowsers[options.browser]);
|
|
62
69
|
}
|
|
63
70
|
|
|
@@ -105,6 +112,15 @@ program
|
|
|
105
112
|
case "ready":
|
|
106
113
|
ws.send(JSON.stringify({ action: "run" }));
|
|
107
114
|
break;
|
|
115
|
+
|
|
116
|
+
case "update":
|
|
117
|
+
if (data.data.passed === true) {
|
|
118
|
+
console.log(chalk.green("✔ "), data.data.title);
|
|
119
|
+
} else {
|
|
120
|
+
console.log(chalk.red("✘ [fail]: "), data.data.title);
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
|
|
108
124
|
case "result":
|
|
109
125
|
const summary = calculateSummary(data.data);
|
|
110
126
|
|
|
@@ -116,7 +132,9 @@ program
|
|
|
116
132
|
};
|
|
117
133
|
|
|
118
134
|
for (const m of summaryMessages(summary)) {
|
|
119
|
-
console.log(
|
|
135
|
+
console.log(
|
|
136
|
+
" " + chalk[classToColor[m.colorClass] || "black"](m.text)
|
|
137
|
+
);
|
|
120
138
|
}
|
|
121
139
|
|
|
122
140
|
await shutdown(summary.failed);
|