33
44import yok = require( '../lib/common/yok' ) ;
55import stubs = require( './stubs' ) ;
6+ import * as constants from "./../lib/constants" ;
7+ import * as ChildProcessLib from "../lib/common/child-process" ;
68
79import ProjectServiceLib = require( "../lib/services/project-service" ) ;
810import ProjectDataServiceLib = require( "../lib/services/project-data-service" ) ;
@@ -69,11 +71,14 @@ class ProjectIntegrationTest {
6971 var appDirectoryPath = path . join ( projectDir , "app" ) ;
7072 var platformsDirectoryPath = path . join ( projectDir , "platforms" ) ;
7173 let tnsProjectFilePath = path . join ( projectDir , "package.json" ) ;
74+ let tnsModulesPath = path . join ( projectDir , constants . NODE_MODULES_FOLDER_NAME , constants . TNS_CORE_MODULES_NAME ) ;
75+
7276 var options = this . testInjector . resolve ( "options" ) ;
7377
7478 assert . isTrue ( fs . exists ( appDirectoryPath ) . wait ( ) ) ;
7579 assert . isTrue ( fs . exists ( platformsDirectoryPath ) . wait ( ) ) ;
7680 assert . isTrue ( fs . exists ( tnsProjectFilePath ) . wait ( ) ) ;
81+ assert . isTrue ( fs . exists ( tnsModulesPath ) . wait ( ) ) ;
7782
7883 assert . isFalse ( fs . isEmptyDir ( appDirectoryPath ) . wait ( ) ) ;
7984 assert . isTrue ( fs . isEmptyDir ( platformsDirectoryPath ) . wait ( ) ) ;
@@ -82,6 +87,9 @@ class ProjectIntegrationTest {
8287 var expectedAppId = appId ;
8388 assert . equal ( actualAppId , expectedAppId ) ;
8489
90+ let tnsCoreModulesRecord = fs . readJson ( tnsProjectFilePath ) . wait ( ) [ "dependencies" ] [ constants . TNS_CORE_MODULES_NAME ] ;
91+ assert . isTrue ( tnsCoreModulesRecord !== null ) ;
92+
8593 var actualFiles = fs . enumerateFilesInDirectorySync ( options . copyFrom ) ;
8694 var expectedFiles = fs . enumerateFilesInDirectorySync ( appDirectoryPath ) ;
8795
@@ -99,7 +107,7 @@ class ProjectIntegrationTest {
99107
100108 private createTestInjector ( ) : void {
101109 this . testInjector = new yok . Yok ( ) ;
102-
110+ this . testInjector . register ( "childProcess" , ChildProcessLib . ChildProcess ) ;
103111 this . testInjector . register ( "errors" , stubs . ErrorsStub ) ;
104112 this . testInjector . register ( 'logger' , stubs . LoggerStub ) ;
105113 this . testInjector . register ( "projectService" , ProjectServiceLib . ProjectService ) ;
@@ -171,6 +179,8 @@ function createTestInjector() {
171179 testInjector . register ( "httpClient" , HttpClientLib . HttpClient ) ;
172180 testInjector . register ( "config" , { } ) ;
173181 testInjector . register ( "lockfile" , stubs . LockFile ) ;
182+
183+ testInjector . register ( "childProcess" , ChildProcessLib . ChildProcess ) ;
174184
175185 testInjector . register ( 'projectData' , ProjectDataLib . ProjectData ) ;
176186 testInjector . register ( "options" , optionsLib . Options ) ;
0 commit comments