@@ -57,7 +57,7 @@ function expectNotToBeInstalled (pkgName) {
5757
5858function expectDevDependenciesToBe ( deps ) {
5959 const rootPJ = fs . readJsonSync ( path . join ( tmpDir , 'package.json' ) ) ;
60- expect ( rootPJ . devDependencies ) . toEqual ( deps ) ;
60+ expect ( rootPJ . devDependencies || { } ) . toEqual ( deps ) ;
6161}
6262
6363describe ( 'fetch/uninstall tests via npm & git' , ( ) => {
@@ -101,7 +101,7 @@ describe('fetch/uninstall with --save', () => {
101101 name : 'cordova-ios' ,
102102 version : '5.0.1'
103103 } ) )
104- . then ( _ => expectDevDependenciesToBe ( { 'cordova-ios' : 'git+https://github.com/apache/cordova-ios.git #rel/5.0.1' } ) )
104+ . then ( _ => expectDevDependenciesToBe ( { 'cordova-ios' : jasmine . stringMatching ( ' #rel/5.0.1') } ) )
105105 . then ( _ => uninstall ( 'cordova-ios' , tmpDir , opts ) )
106106 . then ( _ => expectDevDependenciesToBe ( { } ) )
107107 . then ( _ => expectNotToBeInstalled ( 'cordova-ios' ) )
@@ -111,18 +111,19 @@ describe('fetch/uninstall with --save', () => {
111111 name : 'cordova-android' ,
112112 version : '4.1.1'
113113 } ) )
114- . then ( _ => expectDevDependenciesToBe ( { 'cordova-android' : 'git+https://github.com/apache/cordova-android.git #4.1.x' } ) )
114+ . then ( _ => expectDevDependenciesToBe ( { 'cordova-android' : jasmine . stringMatching ( ' #4.1.x') } ) )
115115 . then ( _ => uninstall ( 'cordova-android' , tmpDir , opts ) ) ;
116116 } , 150000 ) ;
117117
118118 it ( 'should fetch and uninstall a cordova plugin via git commit sha' , ( ) => {
119- const URL = 'https://github.com/apache/cordova-plugin-contacts.git#7db612115755c2be73a98dda76ff4c5fd9d8a575' ;
119+ const SHA = '7db612115755c2be73a98dda76ff4c5fd9d8a575' ;
120+ const URL = `https://github.com/apache/cordova-plugin-contacts.git#${ SHA } ` ;
120121 return Promise . resolve ( )
121122 . then ( _ => fetchAndMatch ( URL , {
122123 name : 'cordova-plugin-contacts' ,
123124 version : '2.0.2-dev'
124125 } ) )
125- . then ( _ => expectDevDependenciesToBe ( { 'cordova-plugin-contacts' : `git+ ${ URL } ` } ) )
126+ . then ( _ => expectDevDependenciesToBe ( { 'cordova-plugin-contacts' : jasmine . stringMatching ( `# ${ SHA } ` ) } ) )
126127 . then ( _ => uninstall ( 'cordova-plugin-contacts' , tmpDir , opts ) )
127128 . then ( _ => expectDevDependenciesToBe ( { } ) )
128129 . then ( _ => expectNotToBeInstalled ( 'cordova-plugin-contacts' ) ) ;
0 commit comments