@reporters/junit 1.1.0 → 1.2.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/CHANGELOG.md +7 -0
- package/README.md +2 -0
- package/package.json +1 -1
- package/tests/index.test.js +33 -5
- package/tests/output.v18.js +6 -0
- package/tests/output.v19.js +6 -0
- package/tests/output.v20.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.2.0](https://github.com/MoLow/reporters/compare/junit-v1.1.0...junit-v1.2.0) (2023-07-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* publish with provenance ([6ee1e46](https://github.com/MoLow/reporters/commit/6ee1e46040329edeb0f40f753093b6952984f001))
|
|
9
|
+
|
|
3
10
|
## [1.1.0](https://github.com/MoLow/reporters/compare/junit-v1.0.4...junit-v1.1.0) (2023-05-30)
|
|
4
11
|
|
|
5
12
|
|
package/README.md
CHANGED
package/package.json
CHANGED
package/tests/index.test.js
CHANGED
|
@@ -1,10 +1,38 @@
|
|
|
1
|
+
const { test } = require('node:test');
|
|
1
2
|
const { spawnSync } = require('child_process');
|
|
2
3
|
const assert = require('assert');
|
|
3
4
|
const { compareLines } = require('../../../tests/utils');
|
|
4
|
-
|
|
5
|
-
const output = require(`./output.${process.version.split('.')[0]}`);
|
|
5
|
+
const reporter = require('../index');
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
test('spwan with reporter', () => {
|
|
8
|
+
// eslint-disable-next-line import/no-dynamic-require, global-require
|
|
9
|
+
const output = require(`./output.${process.version.split('.')[0]}`);
|
|
10
|
+
const child = spawnSync(process.execPath, ['--test-reporter', './index.js', '../../tests/example'], { env: {} });
|
|
11
|
+
assert.strictEqual(child.stderr?.toString(), '');
|
|
12
|
+
compareLines(child.stdout?.toString(), output.stdout);
|
|
13
|
+
});
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
test('empty', async () => {
|
|
16
|
+
const lines = [];
|
|
17
|
+
for await (const line of reporter([])) {
|
|
18
|
+
lines.push(line);
|
|
19
|
+
}
|
|
20
|
+
assert.deepStrictEqual(lines, [
|
|
21
|
+
'<?xml version="1.0" encoding="utf-8"?>\n',
|
|
22
|
+
'<testsuites>\n',
|
|
23
|
+
'</testsuites>\n',
|
|
24
|
+
]);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('single test', async () => {
|
|
28
|
+
const lines = [];
|
|
29
|
+
for await (const line of reporter([{ type: 'test:pass', data: { name: 'test', nesting: 0, details: { duration_ms: 100 } } }])) {
|
|
30
|
+
lines.push(line);
|
|
31
|
+
}
|
|
32
|
+
assert.deepStrictEqual(lines, [
|
|
33
|
+
'<?xml version="1.0" encoding="utf-8"?>\n',
|
|
34
|
+
'<testsuites>\n',
|
|
35
|
+
'\t<undefined name="root">\n\t<testcase name="test" time="0.100000" classname="test"/>\n\t</undefined>\n',
|
|
36
|
+
'</testsuites>\n',
|
|
37
|
+
]);
|
|
38
|
+
});
|
package/tests/output.v18.js
CHANGED
|
@@ -26,6 +26,12 @@ module.exports = {
|
|
|
26
26
|
\t<testsuite name="more tests" time=".*" disabled="0" errors="0" tests="1" failures="0" skipped="0" hostname=".*">
|
|
27
27
|
\t\t<testcase name="is ok" time=".*" classname="test"/>
|
|
28
28
|
\t</testsuite>
|
|
29
|
+
\t<testcase name="is skipped" time=".* classname="test">
|
|
30
|
+
\t\t<skipped type="skipped" message="true"/>
|
|
31
|
+
\t</testcase>
|
|
32
|
+
\t<testcase name="is a todo" time=".*" classname="test">
|
|
33
|
+
\t\t<skipped type="todo" message="true"/>
|
|
34
|
+
\t</testcase>
|
|
29
35
|
</testsuites>
|
|
30
36
|
`,
|
|
31
37
|
};
|
package/tests/output.v19.js
CHANGED
|
@@ -26,6 +26,12 @@ module.exports = {
|
|
|
26
26
|
\t<testsuite name="more tests" time=".*" disabled="0" errors="0" tests="1" failures="0" skipped="0" hostname=".*">
|
|
27
27
|
\t\t<testcase name="is ok" time=".*" classname="test"/>
|
|
28
28
|
\t</testsuite>
|
|
29
|
+
\t<testcase name="is skipped" time=".* classname="test">
|
|
30
|
+
\t\t<skipped type="skipped" message="true"/>
|
|
31
|
+
\t</testcase>
|
|
32
|
+
\t<testcase name="is a todo" time=".*" classname="test">
|
|
33
|
+
\t\t<skipped type="todo" message="true"/>
|
|
34
|
+
\t</testcase>
|
|
29
35
|
</testsuites>
|
|
30
36
|
`,
|
|
31
37
|
};
|
package/tests/output.v20.js
CHANGED
|
@@ -26,6 +26,12 @@ module.exports = {
|
|
|
26
26
|
\t<testsuite name="more tests" time=".*" disabled="0" errors="0" tests="1" failures="0" skipped="0" hostname=".*">
|
|
27
27
|
\t\t<testcase name="is ok" time=".*" classname="test"/>
|
|
28
28
|
\t</testsuite>
|
|
29
|
+
\t<testcase name="is skipped" time=".* classname="test">
|
|
30
|
+
\t\t<skipped type="skipped" message="true"/>
|
|
31
|
+
\t</testcase>
|
|
32
|
+
\t<testcase name="is a todo" time=".*" classname="test">
|
|
33
|
+
\t\t<skipped type="todo" message="true"/>
|
|
34
|
+
\t</testcase>
|
|
29
35
|
</testsuites>
|
|
30
36
|
`,
|
|
31
37
|
};
|