Skip to content

Commit 1d3ab5d

Browse files
committed
Making the "testMatch" property of "IKarmaTaskConfig" optional.
1 parent 8c4bc7c commit 1d3ab5d

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎gulp-core-build-karma/src/KarmaTask.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ import * as KarmaType from 'karma';
88

99
export interface IKarmaTaskConfig {
1010
configPath: string;
11-
/** If specified, a "tests.js" file will be created in the temp folder using
12-
* this RegExp to locate test files.
11+
12+
/**
13+
* If specified, a "tests.js" file will be created in the temp folder using
14+
* this RegExp to locate test files.
1315
*/
14-
testMatch: RegExp | string;
16+
testMatch?: RegExp | string;
1517
}
1618

1719
export class KarmaTask extends GulpTask<IKarmaTaskConfig> {
@@ -66,7 +68,7 @@ export class KarmaTask extends GulpTask<IKarmaTaskConfig> {
6668
this.logWarning(
6769
`No karma config has been provided. ` +
6870
`Run again using --initkarma to create a default config, or call ` +
69-
` karma.setConfig({ configPath: null }) in your gulpfile.`);
71+
`karma.setConfig({ configPath: null }) in your gulpfile.`);
7072
} else {
7173
this.copyFile(path.resolve(__dirname, '../karma.config.js'));
7274

@@ -79,7 +81,7 @@ export class KarmaTask extends GulpTask<IKarmaTaskConfig> {
7981
completeCallback();
8082
} else {
8183
// Normalize the match expression if one was specified
82-
const { testMatch } = this.taskConfig; // tslint:disable-line:typedef
84+
const { testMatch }: IKarmaTaskConfig = this.taskConfig;
8385
if (testMatch) {
8486
let normalizedMatch: RegExp;
8587

0 commit comments

Comments
 (0)