@@ -40,20 +40,20 @@ class ProjectIntegrationTest {
40
40
return projectService . createProject ( projectName ) ;
41
41
}
42
42
43
- public getDefaultTemplatePath ( templateName : string ) : IFuture < string > {
43
+ public getNpmPackagePath ( packageName : string ) : IFuture < string > {
44
44
return ( ( ) => {
45
45
let npmInstallationManager = this . testInjector . resolve ( "npmInstallationManager" ) ;
46
46
let fs = this . testInjector . resolve ( "fs" ) ;
47
47
48
48
let cacheRoot = npmInstallationManager . getCacheRootPath ( ) ;
49
- let defaultTemplatePath = path . join ( cacheRoot , templateName ) ;
50
- let latestVersion = npmInstallationManager . getLatestVersion ( templateName ) . wait ( ) ;
49
+ let defaultTemplatePath = path . join ( cacheRoot , packageName ) ;
50
+ let latestVersion = npmInstallationManager . getLatestVersion ( packageName ) . wait ( ) ;
51
51
52
52
if ( ! fs . exists ( path . join ( defaultTemplatePath , latestVersion ) ) . wait ( ) ) {
53
- npmInstallationManager . addToCache ( templateName , latestVersion ) . wait ( ) ;
53
+ npmInstallationManager . addToCache ( packageName , latestVersion ) . wait ( ) ;
54
54
}
55
55
if ( ! fs . exists ( path . join ( defaultTemplatePath , latestVersion , "package" , "app" ) ) . wait ( ) ) {
56
- npmInstallationManager . cacheUnpack ( templateName , latestVersion ) . wait ( ) ;
56
+ npmInstallationManager . cacheUnpack ( packageName , latestVersion ) . wait ( ) ;
57
57
}
58
58
59
59
return path . join ( defaultTemplatePath , latestVersion , "package" ) ;
@@ -134,7 +134,7 @@ describe("Project Service Tests", () => {
134
134
let options = projectIntegrationTest . testInjector . resolve ( "options" ) ;
135
135
136
136
options . path = tempFolder ;
137
- options . copyFrom = projectIntegrationTest . getDefaultTemplatePath ( "tns-template-hello-world" ) . wait ( ) ;
137
+ options . copyFrom = projectIntegrationTest . getNpmPackagePath ( "tns-template-hello-world" ) . wait ( ) ;
138
138
139
139
projectIntegrationTest . createProject ( projectName ) . wait ( ) ;
140
140
projectIntegrationTest . assertProject ( tempFolder , projectName , "org.nativescript.myapp" ) . wait ( ) ;
@@ -146,7 +146,7 @@ describe("Project Service Tests", () => {
146
146
let options = projectIntegrationTest . testInjector . resolve ( "options" ) ;
147
147
148
148
options . path = tempFolder ;
149
- options . copyFrom = projectIntegrationTest . getDefaultTemplatePath ( "tns-template-hello-world" ) . wait ( ) ;
149
+ options . copyFrom = projectIntegrationTest . getNpmPackagePath ( "tns-template-hello-world" ) . wait ( ) ;
150
150
options . appid = "my.special.id" ;
151
151
152
152
projectIntegrationTest . createProject ( projectName ) . wait ( ) ;
@@ -166,7 +166,7 @@ describe("Project Service Tests", () => {
166
166
let projectIntegrationTest = new ProjectIntegrationTest ( ) ;
167
167
let workingFolderPath = temp . mkdirSync ( "ios_project" ) ;
168
168
169
- let iosTemplatePath = path . join ( projectIntegrationTest . getDefaultTemplatePath ( "tns-ios" ) . wait ( ) , "framework/" ) ;
169
+ let iosTemplatePath = path . join ( projectIntegrationTest . getNpmPackagePath ( "tns-ios" ) . wait ( ) , "framework/" ) ;
170
170
childProcess . exec ( `cp -R ${ iosTemplatePath } ${ workingFolderPath } ` , { cwd : workingFolderPath } ) . wait ( ) ;
171
171
fs . writeFile ( "/tmp/Podfile/testFile.txt" , "Test content." ) . wait ( ) ;
172
172
0 commit comments