Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from technote-space/release/v0.4.1
Browse files Browse the repository at this point in the history
feat: v0.4.1
  • Loading branch information
technote-space committed Sep 27, 2019
2 parents 4a6c028 + 1bc3de2 commit 27da6f4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -3,6 +3,7 @@
[![npm version](https://badge.fury.io/js/%40technote-space%2Fclover-json.svg)](https://badge.fury.io/js/%40technote-space%2Fclover-json)
[![Build Status](https://github.com/technote-space/clover-json/workflows/Build/badge.svg)](https://github.com/technote-space/clover-json/actions)
[![Coverage Status](https://coveralls.io/repos/github/technote-space/clover-json/badge.svg?branch=master)](https://coveralls.io/github/technote-space/clover-json?branch=master)
[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/clover-json/badge)](https://www.codefactor.io/repository/github/technote-space/clover-json)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/technote-space/clover-json/blob/master/LICENSE)

Parse [clover](https://www.atlassian.com/software/clover) report files, and return a JSON representation in a [lcov-parse](https://github.com/davglass/lcov-parse) compatible manner.
Expand All @@ -17,7 +18,9 @@ Parse [clover](https://www.atlassian.com/software/clover) report files, and retu
<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Usage

1. Install
`npm i @technote-space/clover-json`
1.
```typescript
import { parseFile, parseContent } from "@technote-space/clover-json";

Expand Down
4 changes: 3 additions & 1 deletion __tests__/index.test.ts
Expand Up @@ -9,6 +9,9 @@ describe('Check if it can parse a clover file', () => {
const result = await parseFile(getFilePath('clover1.xml'));

expect(result.length).toBe(3);
expect(result[0].file).toBe('coveralls/lib/client.js');
expect(result[1].file).toBe('coveralls/lib/configuration.js');
expect(result[2].file).toBe('coveralls/lib/git_commit.js');
expect(result[0].functions.found).toBe(1);
expect(result[0].functions.hit).toBe(1);
expect(result[0].lines.found).toBe(4);
Expand All @@ -17,7 +20,6 @@ describe('Check if it can parse a clover file', () => {
expect(result[0].functions.details[0].hit).toBe(2);
expect(result[0].lines.details[0].line).toBe(6);
expect(result[0].lines.details[0].hit).toBe(2);

});

it('should parse a second file', async() => {
Expand Down
41 changes: 24 additions & 17 deletions package.json
@@ -1,7 +1,12 @@
{
"name": "@technote-space/clover-json",
"version": "0.4.0",
"version": "0.4.1",
"description": "Parse clover XML coverage reports to JSON, using the same format as lcov-parse",
"author": "TobiLG",
"contributors": [
"Technote <technote.space@gmail.com> (https://technote.space)"
],
"license": "MIT",
"keywords": [
"coverage",
"report",
Expand All @@ -14,27 +19,22 @@
"parser",
"converter"
],
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"test": "yarn lint && yarn cover",
"lint": "eslint src/**/**/*.ts && eslint __tests__/**/**/*.ts",
"cover": "jest --coverage",
"update": "ncu -u && yarn install && yarn upgrade && yarn audit"
},
"homepage": "https://github.com/technote-fork/clover-json",
"repository": {
"type": "git",
"url": "https://github.com/technote-fork/clover-json.git"
},
"author": "TobiLG",
"contributors": [
"Technote <technote.space@gmail.com> (https://technote.space)"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/technote-fork/clover-json/issues"
},
"homepage": "https://github.com/technote-fork/clover-json",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"xml2js": "^0.4.22"
},
"devDependencies": {
"@types/node": "^12.7.8",
"@typescript-eslint/eslint-plugin": "^2.3.1",
Expand All @@ -46,7 +46,14 @@
"ts-jest": "^24.1.0",
"typescript": "^3.6.3"
},
"dependencies": {
"xml2js": "^0.4.22"
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsc",
"test": "yarn lint && yarn cover",
"lint": "eslint src/**/**/*.ts && eslint __tests__/**/**/*.ts",
"cover": "jest --coverage",
"update": "ncu -u && yarn install && yarn upgrade && yarn audit"
}
}

0 comments on commit 27da6f4

Please sign in to comment.