@reporters/mocha 1.3.0 → 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 +5 -8
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,12 +1,9 @@
1
1
  /* eslint-disable class-methods-use-this */
2
2
  /* eslint-disable no-underscore-dangle */
3
- /* eslint-disable max-classes-per-file */
4
3
 
5
- 'use strict';
6
-
7
- const { EventEmitter } = require('node:events');
8
- const Mocha = require('mocha');
9
- const { loadOptions } = require('mocha/lib/cli');
4
+ import { EventEmitter } from 'node:events';
5
+ import Mocha from 'mocha';
6
+ import { loadOptions } from 'mocha/lib/cli/options.js';
10
7
 
11
8
  const {
12
9
  EVENT_RUN_BEGIN,
@@ -309,7 +306,7 @@ class Runner extends EventEmitter {
309
306
  }
310
307
  }
311
308
 
312
- module.exports = async function mochaReporter(source) {
309
+ export default async function mochaReporter(source) {
313
310
  const runner = new Runner();
314
311
  await runner.init();
315
312
 
@@ -329,4 +326,4 @@ module.exports = async function mochaReporter(source) {
329
326
  }
330
327
 
331
328
  runner.end();
332
- };
329
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@reporters/mocha",
3
- "version": "1.3.0",
3
+ "version": "2.0.0",
4
4
  "description": "use any mocha reporter with `node:test`",
5
- "type": "commonjs",
5
+ "type": "module",
6
6
  "keywords": [
7
7
  "node:test",
8
8
  "test",