feat(karma-spec-reporter): type definitions for karma-spec-reporter (#42397)

- type definitions
- tests

Thanks!
This commit is contained in:
Piotr Błażejewicz (Peter Blazejewicz)
2020-02-17 17:33:11 -08:00
committed by GitHub
parent bbf0fe82d5
commit 366bb08b3f
4 changed files with 74 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
// Type definitions for karma-spec-reporter 0.0
// Project: https://github.com/mlex/karma-spec-reporter#readme
// 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 {
/**
* {@link https://github.com/mlex/karma-spec-reporter#configuration}
*/
specReporter?: SpecReporterOptions;
}
interface SpecReporterOptions {
/** limit number of lines logged per test */
maxLogLines?: number;
/** do not print error summary */
suppressErrorSummary?: boolean;
/** do not print information about failed tests */
suppressFailed?: boolean;
/** do not print information about passed tests */
suppressPassed?: boolean;
/** do not print information about skipped tests */
suppressSkipped?: boolean;
/** print the time elapsed for each spec */
showSpecTiming?: boolean;
/** test would finish with error when a first fail occurs */
failFast?: boolean;
}
}
@@ -0,0 +1,17 @@
import karma = require('karma');
const test = (config: karma.Config) => {
config.set({
reporters: ['spec'],
specReporter: {
maxLogLines: 5,
suppressErrorSummary: true,
suppressFailed: false,
suppressPassed: false,
suppressSkipped: true,
showSpecTiming: false,
failFast: true,
},
plugins: ['karma-spec-reporter'],
});
};
+23
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-spec-reporter-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }