mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
feat(karma-remap-coverage): type definition for v0.1 (#42304)
- type definition - tests Thanks!
This commit is contained in:
parent
0cf707a02a
commit
f0cbce3dd9
+31
@@ -0,0 +1,31 @@
|
||||
// Type definitions for karma-remap-coverage 0.1
|
||||
// Project: https://github.com/sshev/karma-remap-coverage#readme
|
||||
// Definitions by: Piotr Błażejewicz (Peter Blazejewicz) <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.2
|
||||
|
||||
/// <reference types="karma-coverage" />
|
||||
|
||||
import 'karma';
|
||||
|
||||
declare module 'karma' {
|
||||
interface ConfigOptions {
|
||||
/**
|
||||
* Key-value pairs where key is report type and value - path to file/dir where to save it.
|
||||
* Reporters like `text-summary`, `text-lcov` and `teamcity` can print out to console as well
|
||||
* - in this case just provide any falsy value instead of path.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* 'text-summary': null, // to show summary in console
|
||||
* html: './coverage/html',
|
||||
* ```
|
||||
*
|
||||
* {@link https://github.com/sshev/karma-remap-coverage#remapcoveragereporter-format }
|
||||
*/
|
||||
remapCoverageReporter?: KarmaRemapCoverageReporter;
|
||||
}
|
||||
|
||||
// remapped reporter types to key-value pairs
|
||||
type KarmaRemapCoverageReporter = Partial<Record<ReporterType, string | null | undefined>>;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { Config } from 'karma';
|
||||
|
||||
module.exports = (config: Config) =>
|
||||
config.set({
|
||||
files: ['./entry-module.spec.ts'],
|
||||
preprocessors: {
|
||||
'./entry-module.spec.ts': ['webpack', 'sourcemap'],
|
||||
'./entry-module.ts': ['coverage'],
|
||||
},
|
||||
// add both "karma-coverage" and "karma-remap-coverage" reporters
|
||||
reporters: ['progress', 'coverage', 'remap-coverage'],
|
||||
|
||||
// save interim raw coverage report in memory
|
||||
coverageReporter: {
|
||||
type: 'in-memory',
|
||||
},
|
||||
|
||||
// define where to save final remaped coverage reports
|
||||
remapCoverageReporter: {
|
||||
'text-summary': null,
|
||||
lcov: undefined,
|
||||
html: './coverage/html',
|
||||
cobertura: './coverage/cobertura.xml',
|
||||
},
|
||||
|
||||
// make sure both reporter plugins are loaded
|
||||
plugins: ['karma-coverage', 'karma-remap-coverage'],
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"karma-remap-coverage-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user