@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.
Files changed (2) hide show
  1. package/index.js +3 -5
  2. 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
- const ms = require('ms');
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
- module.exports = async function* slowTestsReporter(source) {
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
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@reporters/slow",
3
- "version": "1.1.1",
3
+ "version": "2.0.0",
4
4
  "description": "A slow tests reporter for `node:test`",
5
- "type": "commonjs",
5
+ "type": "module",
6
6
  "keywords": [
7
7
  "node:test",
8
8
  "test",