@@ -14,6 +14,7 @@ interface IHostConfiguration {
1414 options : {
1515 debugBrk ?: boolean ;
1616 debugTransport ?: boolean ;
17+ appDirectoryRelativePath ?: string ;
1718 }
1819}
1920
@@ -42,7 +43,10 @@ function enableSocketIoDebugging() {
4243}
4344
4445var 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+ }
4650
4751export class TestBrokerViewModel extends observable . Observable {
4852 private startEmitted : boolean ;
@@ -189,13 +193,13 @@ export class TestBrokerViewModel extends observable.Observable {
189193 }
190194
191195 public viewTestRunDetails ( ) {
192- frameModule . topmost ( ) . navigate ( 'run-details' ) ;
196+ frameModule . getFrameById ( 'root-frame' ) . navigate ( 'run-details' ) ;
193197 }
194198
195199 public beginLocalRun ( ) {
196200 this . config = this . config || { args : [ ] } ;
197201
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' ) ;
199203 }
200204
201205 public onKarmaExecute ( cfg ) {
@@ -225,7 +229,7 @@ export class TestBrokerViewModel extends observable.Observable {
225229 } )
226230 . then ( scriptUrls => {
227231 return Promise . all ( scriptUrls . map ( ( url ) : Promise < IScriptInfo > => {
228- var appPrefix = ' /base/app/' ;
232+ var appPrefix = ` /base/${ config . options . appDirectoryRelativePath } /` ;
229233 if ( url . startsWith ( appPrefix ) ) {
230234 var paramsStart = url . indexOf ( '?' ) ;
231235 var relativePath = url . substring ( appPrefix . length , paramsStart ) ;
@@ -279,7 +283,7 @@ export class TestBrokerViewModel extends observable.Observable {
279283 }
280284
281285 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 } /` ) ;
283287 }
284288
285289 public updateBrowsersInfo ( browsers ) {
0 commit comments