Skip to content

Commit 68472cb

Browse files
authored
Merge pull request microsoft#74 from Microsoft/ianc/fixing-karma-config
Making the "testMatch" property of "IKarmaTaskConfig" optional.
2 parents 8c4bc7c + eaa7a7d commit 68472cb

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/gulp-core-build-karma",
5+
"comment": "Making the \"testMatch\" property of \"IKarmaTaskConfig\" optional.",
6+
"type": "patch"
7+
}
8+
],
9+
"email": "iclanton@users.noreply.github.com"
10+
}

‎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)