Skip to content

Commit dd79fcc

Browse files
author
nickpape-msft
authored
Fixes issue in karma where the tests.js would not be written if the temp/ folder didn't exist (microsoft#80)
* Fix a bug with the KarmaTask * Changefile
1 parent 8f421c7 commit dd79fcc

5 files changed

Lines changed: 19 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": "Fixes a bug where the tests.js would not be written if the temp folder did not exist.",
6+
"type": "patch"
7+
}
8+
],
9+
"email": "nickpape-msft@users.noreply.github.com"
10+
}

‎common/reviews/api/gulp-core-build-webpack.api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class WebpackTask extends GulpTask<IWebpackTaskConfig> {
1313
// (undocumented)
1414
public isEnabled(buildConfig: IBuildConfig): boolean;
1515
// (undocumented)
16-
protected loadSchema(): Object;
16+
public loadSchema(): Object;
1717
// (undocumented)
1818
public name: string;
1919
// (undocumented)

‎common/reviews/api/node-library-build.api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class TypeScriptTask extends GulpTask<ITypeScriptTaskConfig> {
190190
// (undocumented)
191191
getCleanMatch(buildConfig: IBuildConfig, taskConfig?: ITypeScriptTaskConfig): string[];
192192
// (undocumented)
193-
protected loadSchema(): Object;
193+
loadSchema(): Object;
194194
mergeConfig(config: ITypeScriptTaskConfig): void;
195195
// (undocumented)
196196
name: string;

‎common/reviews/api/web-library-build.api.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class TypeScriptTask extends GulpTask<ITypeScriptTaskConfig> {
198198
// (undocumented)
199199
getCleanMatch(buildConfig: IBuildConfig, taskConfig?: ITypeScriptTaskConfig): string[];
200200
// (undocumented)
201-
protected loadSchema(): Object;
201+
loadSchema(): Object;
202202
mergeConfig(config: ITypeScriptTaskConfig): void;
203203
// (undocumented)
204204
name: string;
@@ -224,7 +224,7 @@ class WebpackTask extends GulpTask<IWebpackTaskConfig> {
224224
// (undocumented)
225225
isEnabled(buildConfig: IBuildConfig): boolean;
226226
// (undocumented)
227-
protected loadSchema(): Object;
227+
loadSchema(): Object;
228228
// (undocumented)
229229
name: string;
230230
// (undocumented)

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ export class KarmaTask extends GulpTask<IKarmaTaskConfig> {
111111
].join(os.EOL);
112112
// tslint:enable:max-line-length
113113

114-
fs.writeFileSync(path.join(this.buildConfig.tempFolder, 'tests.js'), testsJsFileContents);
114+
const tempFolder: string = path.join(this.buildConfig.rootPath, this.buildConfig.tempFolder);
115+
if (!fs.existsSync(tempFolder)) {
116+
fs.mkdirSync(tempFolder);
117+
}
118+
fs.writeFileSync(path.join(tempFolder, 'tests.js'), testsJsFileContents);
115119
}
116120

117121
const karma: typeof KarmaType = require('karma'); // tslint:disable-line

0 commit comments

Comments
 (0)