@reporters/slow 1.1.1 → 2.0.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/index.js +3 -5
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/* eslint-disable camelcase */
|
|
4
2
|
/* eslint-disable no-continue */
|
|
5
|
-
|
|
3
|
+
import ms from 'ms';
|
|
6
4
|
|
|
7
5
|
const GRAY = '\x1b[38;5;8m';
|
|
8
6
|
const CLEAR = '\x1b[0m';
|
|
@@ -15,7 +13,7 @@ const THRESHOLDS = [
|
|
|
15
13
|
|
|
16
14
|
const COLORED_CWD = `${GRAY}${process.cwd()}${CLEAR}`;
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
export default async function* slowTestsReporter(source) {
|
|
19
17
|
const files = new Map();
|
|
20
18
|
for await (const event of source) {
|
|
21
19
|
if (event.type !== 'test:pass' && event.type !== 'test:fail') continue;
|
|
@@ -44,4 +42,4 @@ module.exports = async function* slowTestsReporter(source) {
|
|
|
44
42
|
yield ` ${color}-${CLEAR} ${name} [${color}${ms(duration_ms)}${CLEAR}] (${CLEAR}${colord_file}:${line}:${column})\n`;
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
|
-
}
|
|
45
|
+
}
|