3
3
4
4
import yok = require( '../lib/common/yok' ) ;
5
5
import stubs = require( './stubs' ) ;
6
+ import * as constants from "./../lib/constants" ;
7
+ import * as ChildProcessLib from "../lib/common/child-process" ;
6
8
7
9
import ProjectServiceLib = require( "../lib/services/project-service" ) ;
8
10
import ProjectDataServiceLib = require( "../lib/services/project-data-service" ) ;
@@ -69,11 +71,14 @@ class ProjectIntegrationTest {
69
71
var appDirectoryPath = path . join ( projectDir , "app" ) ;
70
72
var platformsDirectoryPath = path . join ( projectDir , "platforms" ) ;
71
73
let tnsProjectFilePath = path . join ( projectDir , "package.json" ) ;
74
+ let tnsModulesPath = path . join ( projectDir , constants . NODE_MODULES_FOLDER_NAME , constants . TNS_CORE_MODULES_NAME ) ;
75
+
72
76
var options = this . testInjector . resolve ( "options" ) ;
73
77
74
78
assert . isTrue ( fs . exists ( appDirectoryPath ) . wait ( ) ) ;
75
79
assert . isTrue ( fs . exists ( platformsDirectoryPath ) . wait ( ) ) ;
76
80
assert . isTrue ( fs . exists ( tnsProjectFilePath ) . wait ( ) ) ;
81
+ assert . isTrue ( fs . exists ( tnsModulesPath ) . wait ( ) ) ;
77
82
78
83
assert . isFalse ( fs . isEmptyDir ( appDirectoryPath ) . wait ( ) ) ;
79
84
assert . isTrue ( fs . isEmptyDir ( platformsDirectoryPath ) . wait ( ) ) ;
@@ -82,6 +87,9 @@ class ProjectIntegrationTest {
82
87
var expectedAppId = appId ;
83
88
assert . equal ( actualAppId , expectedAppId ) ;
84
89
90
+ let tnsCoreModulesRecord = fs . readJson ( tnsProjectFilePath ) . wait ( ) [ "dependencies" ] [ constants . TNS_CORE_MODULES_NAME ] ;
91
+ assert . isTrue ( tnsCoreModulesRecord !== null ) ;
92
+
85
93
var actualFiles = fs . enumerateFilesInDirectorySync ( options . copyFrom ) ;
86
94
var expectedFiles = fs . enumerateFilesInDirectorySync ( appDirectoryPath ) ;
87
95
@@ -99,7 +107,7 @@ class ProjectIntegrationTest {
99
107
100
108
private createTestInjector ( ) : void {
101
109
this . testInjector = new yok . Yok ( ) ;
102
-
110
+ this . testInjector . register ( "childProcess" , ChildProcessLib . ChildProcess ) ;
103
111
this . testInjector . register ( "errors" , stubs . ErrorsStub ) ;
104
112
this . testInjector . register ( 'logger' , stubs . LoggerStub ) ;
105
113
this . testInjector . register ( "projectService" , ProjectServiceLib . ProjectService ) ;
@@ -171,6 +179,8 @@ function createTestInjector() {
171
179
testInjector . register ( "httpClient" , HttpClientLib . HttpClient ) ;
172
180
testInjector . register ( "config" , { } ) ;
173
181
testInjector . register ( "lockfile" , stubs . LockFile ) ;
182
+
183
+ testInjector . register ( "childProcess" , ChildProcessLib . ChildProcess ) ;
174
184
175
185
testInjector . register ( 'projectData' , ProjectDataLib . ProjectData ) ;
176
186
testInjector . register ( "options" , optionsLib . Options ) ;
0 commit comments