feat(karma-brief-reporter): new type definition for v0.2 (#43053)

- definition file
- tests

https://github.com/prantlf/karma-brief-reporter#readme
https://github.com/prantlf/karma-brief-reporter#options

Thanks!
This commit is contained in:
Piotr Błażejewicz (Peter Blazejewicz) 2020-03-27 18:09:16 +01:00 committed by GitHub
parent ffa65b1173
commit 4fce93531e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 95 additions and 0 deletions

54
types/karma-brief-reporter/index.d.ts vendored Normal file
View File

@ -0,0 +1,54 @@
// Type definitions for karma-brief-reporter 0.2
// Project: https://github.com/prantlf/karma-brief-reporter
// Definitions by: Piotr Błażejewicz (Peter Blazejewicz) <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.2
import 'karma';
declare module 'karma' {
interface ConfigOptions {
/**
* Reports test progress statistics and lists failures at the end of a Karma test run.
* {@link https://github.com/prantlf/karma-brief-reporter#options}
*/
briefReporter?: BriefReporterOptions;
}
interface BriefReporterOptions {
/**
* Suppress the error report at the end of the test run
* @default false
*/
suppressErrorReport?: boolean;
/**
* Print the test failures immediately instead of at the end
* @default false
*/
earlyErrorReport?: boolean;
/**
* Suppress the red background on errors in the error
* report at the end of the test run.
* @default false
*/
suppressErrorHighlighting?: boolean;
/**
* Omits stack frames from external dependencies like qunit,
* jasmine or chai, which appear in stack traces of failed
* tests and which are usually irrelevant to the tested code
* @default false
*/
omitExternalStackFrames?: boolean;
/**
* Suppress the browser console log at the end of the test run
* @default false
*/
suppressBrowserLogs?: boolean;
/**
* Only render the graphic after all tests have finished.
* This is ideal for using this reporter in a continuous integration environment
* @default false
*/
renderOnRunCompleteOnly?: boolean;
}
}

View File

@ -0,0 +1,17 @@
import karma = require('karma');
module.exports = (config: karma.Config) => {
config.set({
// Choose the reporter
reporters: ['brief'],
// Test reporter options
briefReporter: {
suppressErrorReport: true,
earlyErrorReport: true,
suppressErrorHighlighting: true,
omitExternalStackFrames: true,
suppressBrowserLogs: true,
renderOnRunCompleteOnly: true,
},
});
};

View File

@ -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-brief-reporter-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }