Skip to content

Commit

Permalink
add type declaration file (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
xfh committed Jun 17, 2020
1 parent df279fb commit c95aac7
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 11 deletions.
30 changes: 30 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'karma';

export interface SonarqubeReporterConfiguration {
/** test files folder */
basePath: string;
/** test files glob pattern */
filePattern: string;
/** test files encoding */
encoding: string;
/** report destination */
outputFolder: string;
/** report for Sonarqube < 6.2 (disabled) */
legacyMode?: boolean;
/**
* report name callback, accepts also a string (reportName: 'report.xml') to generate a single file
*
* Report metadata array:
* - metadata[0] = browser name
* - metadata[1] = browser version
* - metadata[2] = plataform name
* - metadata[3] = plataform version
*/
reportName: ((metadata: string[]) => string) | string;
}

declare module 'karma' {
interface ConfigOptions {
sonarqubeReporter?: SonarqubeReporterConfiguration;
}
}
134 changes: 124 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.3.0",
"description": "A karma reporter plugin for generating Sonarqube generic test reports",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "nyc jasmine && nyc report --reporter=lcov --reporter=text-lcov | coveralls"
},
Expand All @@ -21,10 +22,13 @@
},
"homepage": "https://github.com/fadc80/karma-sonarqube-reporter#readme",
"dependencies": {
"@types/glob": "^7.1.2",
"@types/karma": "*",
"@types/mkdirp": "^0.5.2",
"clone-regexp": "^2.0.0",
"glob": "^7.1.2",
"js2xmlparser": "^4.0.0",
"mkdirp": "^0.5.1",
"mkdirp": "^0.5.5",
"winston": "^3.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit c95aac7

Please sign in to comment.