@@ -53,7 +53,11 @@ describe("projectData", () => {
5353 dependencies ?: IStringDictionary ;
5454 devDependencies : IStringDictionary ;
5555 } ;
56- configData ?: { shared ?: boolean ; webpackConfigPath ?: string } ;
56+ configData ?: {
57+ shared ?: boolean ;
58+ webpackConfigPath ?: string ;
59+ projectName ?: string ;
60+ } ;
5761 } ) : IProjectData => {
5862 const testInjector = createTestInjector ( ) ;
5963 const fs = testInjector . resolve ( "fs" ) ;
@@ -172,6 +176,20 @@ describe("projectData", () => {
172176 } ) ;
173177 } ) ;
174178
179+ describe ( "projectName" , ( ) => {
180+ it ( "has correct name when no value is set in nativescript.conf" , ( ) => {
181+ const projectData = prepareTest ( ) ;
182+ assert . isString ( "projectDir" , projectData . projectName ) ;
183+ } ) ;
184+
185+ it ( "has correct name when a project name is set in nativescript.conf" , ( ) => {
186+ const projectData = prepareTest ( {
187+ configData : { projectName : "specifiedProjectName" } ,
188+ } ) ;
189+ assert . isString ( "specifiedProjectName" , projectData . projectName ) ;
190+ } ) ;
191+ } ) ;
192+
175193 describe ( "webpackConfigPath" , ( ) => {
176194 it ( "default path to webpack.config.js is set when nsconfig.json does not set value" , ( ) => {
177195 const projectData = prepareTest ( ) ;
0 commit comments