1.3.1 • Published 2 months ago

@reporters/junit v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

npm version tests codecov

Junit Reporter

A Junit reporter for node:test. intendend for use with major CI tools like Jenkins, CircleCI, etc that consume Junit reports.

Installation

npm install --save-dev @reporters/junit

or

yarn add --dev @reporters/junit

Usage

node --test \
  --test-reporter=@reporters/junit --test-reporter-destination=stdout \
  --test-reporter=spec --test-reporter-destination=stdout

Example

Ouput of the following test file:

const { describe, it } = require('node:test');

describe('tests', () => {
  it('is ok', () => {});
  it('fails', () => {
    throw new Error('this is an error');
  });
});
  <testsuite name="tests" time="0.00239" disabled="0" errors="0" tests="2" failures="1" skipped="0" hostname="PC.localdomain">
    <testcase name="is ok" time="0.00057" classname="test"></testcase>
    <testcase name="fails" time="0.00017" classname="test" failure="this is an error">
      <failure message="this is an error" type="testCodeFailure">
[Error [ERR_TEST_FAILURE]: this is an error] {
  failureType: 'testCodeFailure',
  cause: Error: this is an error
      at Object.&lt;anonymous&gt; (/Users/test/reporters/tests/example.js:6:11)
      at ItTest.runInAsyncScope (node:async_hooks:204:9)
      at ItTest.run (node:internal/test_runner/test:547:25)
      at Suite.processPendingSubtests (node:internal/test_runner/test:302:27)
      at ItTest.postRun (node:internal/test_runner/test:632:19)
      at ItTest.run (node:internal/test_runner/test:575:10)
      at async Promise.all (index 0)
      at async Suite.run (node:internal/test_runner/test:798:7),
  code: 'ERR_TEST_FAILURE'
}
      </failure>
    </testcase>
  </testsuite>
</testsuites>
1.3.1

2 months ago

1.3.0

3 months ago

1.2.6

4 months ago

1.2.0

10 months ago

1.2.5

8 months ago

1.2.4

9 months ago

1.2.3

10 months ago

1.2.2

10 months ago

1.2.1

10 months ago

1.1.0

12 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago