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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-ava",
3
- "version": "1.0.4",
3
+ "version": "1.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -172,6 +172,9 @@ async function runTest(parent, tm, test) {
172
172
  test.passed = false;
173
173
  test.message = e;
174
174
  }
175
+ finally {
176
+ ws.send(stringify({ action: "update", data: test }));
177
+ }
175
178
  }
176
179
  }
177
180
 
@@ -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(" " + chalk[classToColor[m.colorClass] || "black"](m.text));
135
+ console.log(
136
+ " " + chalk[classToColor[m.colorClass] || "black"](m.text)
137
+ );
120
138
  }
121
139
 
122
140
  await shutdown(summary.failed);