Security News
OpenJS: “XZ Utils Cyberattack Likely Not an Isolated Incident”
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.
junit-xml
Advanced tools
Weekly downloads
Readme
JUnit XML report builder with TypeScript support.
npm install junit-xml
import { getJunitXml } from 'junit-xml';
const testSuiteReport = {
name: 'Some test suite report name',
time: 4.2,
suites: [
{
name: 'Some suite',
timestamp: new Date(Date.UTC(1989, 10, 3)),
hostname: 'some-hostname',
time: 1.1337,
testCases: [
{
name: 'Successful test',
assertions: 2,
classname: 'successful-test-class',
time: 0.72,
},
{
name: 'Skipped test',
assertions: 2,
skipped: true,
},
{
name: 'Unskipped test',
skipped: false,
},
{
name: 'Failing test',
failures: [
{ message: 'First failure', type: 'some-type' },
{ message: 'Second failure' },
],
},
{
name: 'Another failing test',
failures: [
{ message: 'Just one failure' },
],
},
{
name: 'Erroring test',
errors: [
{ message: 'First error', type: 'some-type' },
{ message: 'Second error' },
],
},
{
name: 'Another erroring test',
errors: [
{ message: 'Just one error' },
],
},
{
name: 'Test with output',
systemOut: [
'First output',
'Second output',
],
},
{
name: 'Test with single output',
systemOut: [
'Only output',
],
},
{
name: 'Test with error output',
systemErr: [
'First error output',
'Second error output',
],
},
{
name: 'Test with single error output',
systemErr: [
'Only error output',
],
},
],
},
{
name: 'Suite without test cases',
testCases: [],
},
{
name: 'Another suite',
testCases: [
{ name: 'Some successful test' },
],
},
],
};
const junitXml = getJunitXml(testSuiteReport);
getJunitXml(testSuiteReport: TestSuiteReport, options?: { schema: 'default' | 'ant-junit' }): string
testSuiteReport
A Javascript object representation of your test suite report. See the type definitions for available properties.
options
Optional object configuring the output. Properties:
schema: 'default' | 'ant-junit'
Default: 'default'
The required format of the resulting XML string. By default, this is set to the format expected by GitLab CI/CD. Alternative options:
'ant-junit'
: The format used by Azure DevOps. Conforms to this schema: https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsdAn XML string in JUnit test report format.
See CHANGELOG.
MIT © Vincent Tunru
FAQs
JUnit XML report builder with TypeScript support
The npm package junit-xml receives a total of 14,203 weekly downloads. As such, junit-xml popularity was classified as popular.
We found that junit-xml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.
Company News
Come meet the Socket team at BSidesSF and RSA! We're sponsoring several fun networking events and we would love to see you there.
Security News
OSI is starting a conversation aimed at removing the excuse of the SaaS loophole for companies navigating licensing and the complexities of doing business with open source.