@reporters/junit 1.6.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 +4 -6
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,7 +1,5 @@
1
- 'use strict';
2
-
3
- const util = require('node:util');
4
- const { hostname } = require('node:os');
1
+ import util from 'node:util';
2
+ import { hostname } from 'node:os';
5
3
 
6
4
  const HOSTNAME = hostname();
7
5
 
@@ -39,7 +37,7 @@ function isSkipped(node) {
39
37
  return node?.children.some((c) => c.tag === 'skipped') || node?.props?.skipped;
40
38
  }
41
39
 
42
- module.exports = async function* junitReporter(source) {
40
+ export default async function* junitReporter(source) {
43
41
  yield '<?xml version="1.0" encoding="utf-8"?>\n';
44
42
  yield '<testsuites>\n';
45
43
  let currentSuite = null;
@@ -123,4 +121,4 @@ module.exports = async function* junitReporter(source) {
123
121
  yield treeToXML(suite);
124
122
  }
125
123
  yield '</testsuites>\n';
126
- };
124
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@reporters/junit",
3
- "version": "1.6.0",
3
+ "version": "2.0.0",
4
4
  "description": "A jUnit reporter for `node:test`",
5
- "type": "commonjs",
5
+ "type": "module",
6
6
  "keywords": [
7
7
  "junit",
8
8
  "node:test",