Merge pull request #22246 from 43081j/karma-options

add karma client options
This commit is contained in:
Paul van Brenk
2017-12-27 15:49:46 -08:00
committed by GitHub
2 changed files with 27 additions and 1 deletions
+14
View File
@@ -1,6 +1,7 @@
// Type definitions for karma 1.7
// Project: https://github.com/karma-runner/karma
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// James Garbutt <https://github.com/43081j>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -414,6 +415,19 @@ declare namespace karma {
* @description Capture all console output and pipe it to the terminal.
*/
captureConsole?: boolean;
/**
* @default false
* @description Run the tests on the same window as the client, without using iframe or a new window
*/
runInParent?: boolean;
/**
* @default true
* @description Clear the context window
* If true, Karma clears the context window upon the completion of running the tests.
* If false, Karma does not clear the context window upon the completion of running the tests.
* Setting this to false is useful when embedding a Jasmine Spec Runner Template.
*/
clearContext?: boolean;
}
interface FilePattern {
+13 -1
View File
@@ -51,7 +51,7 @@ server.on('run_complete', (browsers, results) => {
results.error = false;
results.exitCode = 0;
results.failed = 9;
results.success = 10;
results.success = 10;
});
//var runner = require('karma').runner; => cannot use this syntax otherwise runner is of type any
@@ -108,3 +108,15 @@ module.exports = function(config: karma.Config) {
singleRun: true
});
};
const foo = (config: karma.Config) => {
config.set({
client: {
args: ['a', 'b'],
useIframe: true,
runInParent: true,
captureConsole: true,
clearContext: true
}
});
};