Skip to content

Commit 1a46102

Browse files
committed
don't require non-test scripts present in context.json
1 parent 3443a2d commit 1a46102

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

main-view-model.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export class TestBrokerViewModel extends observable.Observable {
153153
var connected = this.updateBanner('connected');
154154

155155
socket.on('connect', err => {
156-
console.log('UTR: successfully connected to karma');
156+
console.log('NSUTR: successfully connected to karma');
157157

158158
connected();
159159

@@ -233,11 +233,13 @@ export class TestBrokerViewModel extends observable.Observable {
233233
}
234234
}));
235235
})
236-
.then(scriptsContents => setTimeout(() => this.runTests(scriptsContents), 0));
236+
.then((scriptsContents: IScriptInfo[]) => setTimeout(() => this.runTests(scriptsContents), 0));
237237
}
238238

239-
public runTests(testScripts) {
240-
testScripts.forEach((script, i) => {
239+
public runTests(testScripts: IScriptInfo[]): void {
240+
testScripts
241+
.filter(script => this.isTestScript(script.url))
242+
.forEach(script => {
241243
if (script.localPath) {
242244
console.log('NSUTR: require script ' + script.url + ' from ' + script.localPath);
243245
require(script.localPath);
@@ -255,6 +257,10 @@ export class TestBrokerViewModel extends observable.Observable {
255257
this.start(this.config);
256258
}
257259

260+
private isTestScript(url: string): boolean {
261+
return url.startsWith('/base/app/tests/') || !url.startsWith('/base/app/');
262+
}
263+
258264
public updateBrowsersInfo(browsers) {
259265
//console.dir(browsers);
260266
}

0 commit comments

Comments
 (0)