@@ -2,12 +2,13 @@ import * as yok from "../lib/common/yok";
2
2
import * as stubs from "./stubs" ;
3
3
import * as PlatformServiceLib from "../lib/services/platform-service" ;
4
4
import * as StaticConfigLib from "../lib/config" ;
5
- import { VERSION_STRING , PACKAGE_JSON_FILE_NAME } from "../lib/constants" ;
5
+ import { VERSION_STRING , PACKAGE_JSON_FILE_NAME , AddPlaformErrors } from "../lib/constants" ;
6
6
import * as fsLib from "../lib/common/file-system" ;
7
7
import * as optionsLib from "../lib/options" ;
8
8
import * as hostInfoLib from "../lib/common/host-info" ;
9
9
import * as ProjectFilesManagerLib from "../lib/common/services/project-files-manager" ;
10
10
import * as path from "path" ;
11
+ import { format } from "util" ;
11
12
import { assert } from "chai" ;
12
13
import { DeviceAppDataFactory } from "../lib/common/mobile/device-app-data/device-app-data-factory" ;
13
14
import { LocalToDevicePathDataFactory } from "../lib/common/mobile/local-to-device-path-data-factory" ;
@@ -232,6 +233,16 @@ describe('Platform Service Tests', () => {
232
233
await assert . isRejected ( platformService . addPlatforms ( [ "android" ] , "" , projectData , config ) , errorMessage ) ;
233
234
} ) ;
234
235
236
+ it ( "fails when path passed to frameworkPath does not exist" , async ( ) => {
237
+ const fs = testInjector . resolve ( "fs" ) ;
238
+ fs . exists = ( ) => false ;
239
+
240
+ const projectData : IProjectData = testInjector . resolve ( "projectData" ) ;
241
+ const frameworkPath = "invalidPath" ;
242
+ const errorMessage = format ( AddPlaformErrors . InvalidFrameworkPathStringFormat , frameworkPath ) ;
243
+ await assert . isRejected ( platformService . addPlatforms ( [ "android" ] , "" , projectData , config , frameworkPath ) , errorMessage ) ;
244
+ } ) ;
245
+
235
246
const assertCorrectDataIsPassedToPacoteService = async ( versionString : string ) : Promise < void > => {
236
247
const fs = testInjector . resolve ( "fs" ) ;
237
248
fs . exists = ( ) => false ;
0 commit comments