@@ -8,10 +8,9 @@ import Future = require('fibers/future');
88import * as os from 'os' ;
99
1010class TestExecutionService implements ITestExecutionService {
11- private static RUNNER_BASE_PATH = './tns_modules/nativescript-unit-test-runner/' ;
12- private static MAIN_APP_NAME = TestExecutionService . RUNNER_BASE_PATH + 'app.js' ;
13- private static CONFIG_FILE_NAME = TestExecutionService . RUNNER_BASE_PATH + 'config.js' ;
14- private static SOCKETIO_JS_FILE_NAME = TestExecutionService . RUNNER_BASE_PATH + 'socket.io.js' ;
11+ private static MAIN_APP_NAME = `./tns_modules/${ constants . TEST_RUNNER_NAME } /app.js` ;
12+ private static CONFIG_FILE_NAME = `node_modules/${ constants . TEST_RUNNER_NAME } /config.js` ;
13+ private static SOCKETIO_JS_FILE_NAME = `node_modules/${ constants . TEST_RUNNER_NAME } /socket.io.js` ;
1514
1615 constructor (
1716 private $projectData : IProjectData ,
@@ -29,21 +28,24 @@ class TestExecutionService implements ITestExecutionService {
2928
3029 public startTestRunner ( platform : string ) : IFuture < void > {
3130 return ( ( ) => {
31+ this . $options . justlaunch = true ;
32+
3233 let platformData = this . $platformsData . getPlatformData ( platform ) ;
34+ let projectDir = this . $projectData . projectDir ;
3335
3436 let projectFilesPath = path . join ( platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ;
3537
36- this . $platformService . preparePlatform ( platform ) . wait ( ) ;
37- this . detourEntryPoint ( projectFilesPath ) . wait ( ) ;
38-
3938 let configJs = this . generateConfig ( this . $options . port ) ;
40- this . $fs . writeFile ( path . join ( projectFilesPath , TestExecutionService . CONFIG_FILE_NAME ) , configJs ) . wait ( ) ;
39+ this . $fs . writeFile ( path . join ( projectDir , TestExecutionService . CONFIG_FILE_NAME ) , configJs ) . wait ( ) ;
4140
4241 let socketIoJsUrl = `http://localhost:${ this . $options . port } /socket.io/socket.io.js` ;
4342 let socketIoJs = this . $httpClient . httpRequest ( socketIoJsUrl ) . wait ( ) . body ;
44- this . $fs . writeFile ( path . join ( projectFilesPath , TestExecutionService . SOCKETIO_JS_FILE_NAME ) , socketIoJs ) . wait ( ) ;
43+ this . $fs . writeFile ( path . join ( projectDir , TestExecutionService . SOCKETIO_JS_FILE_NAME ) , socketIoJs ) . wait ( ) ;
44+
45+ this . $platformService . preparePlatform ( platform ) . wait ( ) ;
46+ this . detourEntryPoint ( projectFilesPath ) . wait ( ) ;
4547
46- let watchGlob = path . join ( this . $projectData . projectDir , constants . APP_FOLDER_NAME ) ;
48+ let watchGlob = path . join ( projectDir , constants . APP_FOLDER_NAME ) ;
4749
4850 let platformSpecificLiveSyncServices : IDictionary < any > = {
4951 android : ( _device : Mobile . IDevice , $injector : IInjector ) : IPlatformSpecificLiveSyncService => {
0 commit comments