Skip to content

Commit

Permalink
Reformat everything with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
davidparsson committed Oct 10, 2023
1 parent f7c43f7 commit e59ad46
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 59 deletions.
40 changes: 19 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,34 @@ on: [push, pull_request]

jobs:
test:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [8.x, 10.x, 12.x, 13.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm test
env:
CI: true
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm test
env:
CI: true

formatting:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 20.x
- name: npm install, check formatting
run: |
npm install
npm run check
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 20.x
- name: npm install, check formatting
run: |
npm install
npm run check
70 changes: 40 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
junit-report-builder
====================
# junit-report-builder

[![Build Status](https://github.com/davidparsson/junit-report-builder/workflows/CI/badge.svg)](https://github.com/davidparsson/junit-report-builder/actions?query=workflow%3ACI)
[![Weekly Downloads](https://img.shields.io/npm/dw/junit-report-builder.svg)](https://www.npmjs.com/package/junit-report-builder)

A project aimed at making it easier to build [Jenkins](http://jenkins-ci.org/) compatible XML based JUnit reports.

Installation
------------
## Installation

To install the latest version, run:

npm install junit-report-builder --save

Usage
-----
## Usage

```JavaScript
var builder = require('junit-report-builder');
Expand Down Expand Up @@ -52,66 +49,79 @@ This will create `test-report.xml` containing the following:

If you want to create another report file, start by getting a new
builder instance like this:

```JavaScript
builder = builder.newBuilder();
```

Please refer to the [e2e_spec.coffee](spec/e2e_spec.coffee) for more details on the usage.

License
-------
## License

[MIT](LICENSE)

Changelog
---------
## Changelog

### 3.0.1
- Bump dependencies: lodash, make-dir, date-format, minimist

- Bump dependencies: lodash, make-dir, date-format, minimist

### 3.0.0
- Properly prevent invalid characters from being included in the XML files.
- Dropped support for node.js 4 and 6

- Properly prevent invalid characters from being included in the XML files.
- Dropped support for node.js 4 and 6

### 2.1.0
- Added support for adding a `file` attribute to a test case. Thanks to [Ben Holland](https://github.com/hollandben).

- Added support for adding a `file` attribute to a test case. Thanks to [Ben Holland](https://github.com/hollandben).

### 2.0.0
- Replace mkdirp by make-dir to resolve [npm advisory 1179](https://www.npmjs.com/advisories/1179).
- Dropped support for node.js 0.10.x and 0.12.x

- Replace mkdirp by make-dir to resolve [npm advisory 1179](https://www.npmjs.com/advisories/1179).
- Dropped support for node.js 0.10.x and 0.12.x

### 1.3.3
- Updated lodash to a version without known vulnerabilities.

- Updated lodash to a version without known vulnerabilities.

### 1.3.2
- Added support for emitting the type attribute for error and failure elements of test cases
- Added support for emitting cdata/content for the error element of a test case

- Added support for emitting the type attribute for error and failure elements of test cases
- Added support for emitting cdata/content for the error element of a test case

Thanks to [Robert Turner](https://github.com/rturner-edjuster).

### 1.3.1
- Update dependencies to versions without known vulnerabilities.

- Update dependencies to versions without known vulnerabilities.

### 1.3.0
- Support [attaching files to tests](http://kohsuke.org/2012/03/13/attaching-files-to-junit-tests/). Thanks to [anto-wahanda](https://github.com/anto-wahanda).

- Support [attaching files to tests](http://kohsuke.org/2012/03/13/attaching-files-to-junit-tests/). Thanks to [anto-wahanda](https://github.com/anto-wahanda).

### 1.2.0
- Support creating XML with emojis. Thanks to [ischwarz](https://github.com/ischwarz).

- Support creating XML with emojis. Thanks to [ischwarz](https://github.com/ischwarz).

### 1.1.1
- Changed `date-format` to be a dependency. Previously it was incorrectly set to be a devDependency. Thanks to [georgecrawford](https://github.com/georgecrawford).

- Changed `date-format` to be a dependency. Previously it was incorrectly set to be a devDependency. Thanks to [georgecrawford](https://github.com/georgecrawford).

### 1.1.0
- Added attributes for test count, failure count, error count and skipped test count to testsuite elements
- Added ability to attach standard output and standard error logs to test cases
- Added ability set execution time for test suites
- Added ability set timestamp for test suites

- Added attributes for test count, failure count, error count and skipped test count to testsuite elements
- Added ability to attach standard output and standard error logs to test cases
- Added ability set execution time for test suites
- Added ability set timestamp for test suites

### 1.0.0
- Simplified API by making the index module export a builder instance

- Simplified API by making the index module export a builder instance

### 0.0.2
- Corrected example in readme

- Corrected example in readme

### 0.0.1
- Initial release

- Initial release
3 changes: 1 addition & 2 deletions src/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ var Builder = require('./builder');
var TestSuite = require('./test_suite');
var TestCase = require('./test_case');

function Factory() {
}
function Factory() {}

Factory.prototype.newBuilder = function () {
return new Builder(this);
Expand Down
5 changes: 1 addition & 4 deletions src/test_case.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ TestCase.prototype.build = function (parentElement) {
});
}
if (this._failure) {
var failureElement = testCaseElement.ele(
'failure',
this._failureAttributes
);
var failureElement = testCaseElement.ele('failure', this._failureAttributes);
if (this._stacktrace) {
failureElement.cdata(this._stacktrace);
}
Expand Down
4 changes: 2 additions & 2 deletions src/test_suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TestSuite.prototype.timestamp = function (timestamp) {
};

TestSuite.prototype.property = function (name, value) {
this._properties.push({'name': name, 'value': value});
this._properties.push({ name: name, value: value });
return this;
};

Expand Down Expand Up @@ -73,7 +73,7 @@ TestSuite.prototype.build = function (parentElement) {
_.forEach(this._properties, function (property) {
propertiesElement.ele('property', {
name: property.name,
value: property.value
value: property.value,
});
});
}
Expand Down

0 comments on commit e59ad46

Please sign in to comment.