diff --git a/types/karma-brief-reporter/index.d.ts b/types/karma-brief-reporter/index.d.ts new file mode 100644 index 0000000000..a360bea958 --- /dev/null +++ b/types/karma-brief-reporter/index.d.ts @@ -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) +// 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; + } +} diff --git a/types/karma-brief-reporter/karma-brief-reporter-tests.ts b/types/karma-brief-reporter/karma-brief-reporter-tests.ts new file mode 100644 index 0000000000..f7f9d97b08 --- /dev/null +++ b/types/karma-brief-reporter/karma-brief-reporter-tests.ts @@ -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, + }, + }); +}; diff --git a/types/karma-brief-reporter/tsconfig.json b/types/karma-brief-reporter/tsconfig.json new file mode 100644 index 0000000000..c596310ea4 --- /dev/null +++ b/types/karma-brief-reporter/tsconfig.json @@ -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" + ] +} diff --git a/types/karma-brief-reporter/tslint.json b/types/karma-brief-reporter/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/karma-brief-reporter/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }