@@ -14,6 +14,7 @@ interface IHostConfiguration {
14
14
options : {
15
15
debugBrk ?: boolean ;
16
16
debugTransport ?: boolean ;
17
+ appDirectoryRelativePath ?: string ;
17
18
}
18
19
}
19
20
@@ -42,7 +43,10 @@ function enableSocketIoDebugging() {
42
43
}
43
44
44
45
var config : INetworkConfiguration = require ( './config' ) ;
45
- config . options = config . options || { }
46
+ config . options = config . options || { } ;
47
+ if ( ! config . options . appDirectoryRelativePath ) {
48
+ config . options . appDirectoryRelativePath = "app" ;
49
+ }
46
50
47
51
export class TestBrokerViewModel extends observable . Observable {
48
52
private startEmitted : boolean ;
@@ -189,13 +193,13 @@ export class TestBrokerViewModel extends observable.Observable {
189
193
}
190
194
191
195
public viewTestRunDetails ( ) {
192
- frameModule . topmost ( ) . navigate ( 'run-details' ) ;
196
+ frameModule . getFrameById ( 'root-frame' ) . navigate ( 'run-details' ) ;
193
197
}
194
198
195
199
public beginLocalRun ( ) {
196
200
this . config = this . config || { args : [ ] } ;
197
201
198
- frameModule . topmost ( ) . navigate ( 'tns_modules/nativescript-unit-test-runner/test-run-page' ) ;
202
+ frameModule . getFrameById ( 'root-frame' ) . navigate ( 'tns_modules/nativescript-unit-test-runner/test-run-page' ) ;
199
203
}
200
204
201
205
public onKarmaExecute ( cfg ) {
@@ -225,7 +229,7 @@ export class TestBrokerViewModel extends observable.Observable {
225
229
} )
226
230
. then ( scriptUrls => {
227
231
return Promise . all ( scriptUrls . map ( ( url ) : Promise < IScriptInfo > => {
228
- var appPrefix = ' /base/app/' ;
232
+ var appPrefix = ` /base/${ config . options . appDirectoryRelativePath } /` ;
229
233
if ( url . startsWith ( appPrefix ) ) {
230
234
var paramsStart = url . indexOf ( '?' ) ;
231
235
var relativePath = url . substring ( appPrefix . length , paramsStart ) ;
@@ -279,7 +283,7 @@ export class TestBrokerViewModel extends observable.Observable {
279
283
}
280
284
281
285
private isTestScript ( url : string ) : boolean {
282
- return url . startsWith ( ' /base/app /tests/' ) || ! url . startsWith ( ' /base/app/' ) ;
286
+ return url . startsWith ( ` /base/${ config . options . appDirectoryRelativePath } /tests/` ) || ! url . startsWith ( ` /base/${ config . options . appDirectoryRelativePath } /` ) ;
283
287
}
284
288
285
289
public updateBrowsersInfo ( browsers ) {
0 commit comments