eyeling 1.33.3 → 1.33.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/test/run.js +21 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyeling",
3
- "version": "1.33.3",
3
+ "version": "1.33.4",
4
4
  "description": "A minimal Notation3 (N3) reasoner in JavaScript.",
5
5
  "main": "./index.js",
6
6
  "keywords": [
package/test/run.js CHANGED
@@ -126,9 +126,26 @@ function addSectionToAggregate(summary) {
126
126
  aggregate.nonconform += failed;
127
127
  }
128
128
 
129
- function scoreLine() {
129
+ function scoreColor(score) {
130
+ if (aggregate.crashed || aggregate.nonconform) return C.r;
131
+ if (aggregate.incomplete || score < 100) return C.y;
132
+ return C.g;
133
+ }
134
+
135
+ function scoreLine(elapsedMs) {
130
136
  const score = aggregate.total === 0 ? 0 : (100 * aggregate.ok) / aggregate.total;
131
- return `TOTAL [COUNT:${aggregate.total}] OK: ⭐${aggregate.ok}⭐ INCOMPLETE: ⭐${aggregate.incomplete}⭐ NONCONFORM: ⭐${aggregate.nonconform}⭐ CRASHED: ⭐${aggregate.crashed}⭐ => SCORE: ⭐⭐⭐${score.toFixed(1)}⭐⭐⭐`;
137
+ const scoreC = scoreColor(score);
138
+ return [
139
+ `${C.dim}TOTAL${C.n}`,
140
+ `${C.dim}[COUNT:${aggregate.total}]${C.n}`,
141
+ `${C.g}OK:${C.n} ${C.y}⭐${aggregate.ok}⭐${C.n}`,
142
+ `${C.r}INCOMPLETE:${C.n} ${C.y}⭐${aggregate.incomplete}⭐${C.n}`,
143
+ `${C.r}NONCONFORM:${C.n} ${C.y}⭐${aggregate.nonconform}⭐${C.n}`,
144
+ `${C.r}CRASHED:${C.n} ${C.y}⭐${aggregate.crashed}⭐${C.n}`,
145
+ '=>',
146
+ `${scoreC}SCORE:${C.n} ${C.y}⭐⭐⭐${score.toFixed(1)}⭐⭐⭐${C.n}`,
147
+ `${C.dim}ELAPSED:${C.n} ${C.y}${formatDuration(elapsedMs)}${C.n}`,
148
+ ].join(' ');
132
149
  }
133
150
 
134
151
  function childEnv() {
@@ -194,6 +211,7 @@ function runSection(label, cmd, args) {
194
211
  }
195
212
 
196
213
  (async function main() {
214
+ const suiteStartedAt = Date.now();
197
215
  let status = 0;
198
216
  for (const [label, cmd, args] of sections) {
199
217
  const sectionStatus = await runSection(label, cmd, args);
@@ -204,7 +222,7 @@ function runSection(label, cmd, args) {
204
222
  }
205
223
 
206
224
  console.log('');
207
- console.log(scoreLine());
225
+ console.log(scoreLine(Date.now() - suiteStartedAt));
208
226
 
209
227
  process.exit(status);
210
228
  })();