@@ -160,59 +160,59 @@ describe('plugman/install', () => {
160
160
execaSpy . and . returnValue ( Promise . resolve ( { stdout : '2.5.0' } ) ) ;
161
161
return install ( 'android' , project , pluginDir ( 'com.cordova.engine' ) )
162
162
. then ( ( ) => {
163
- expect ( satisfies ) . toHaveBeenCalledWith ( '2.5.0' , '>=1.0.0' , true ) ;
163
+ expect ( satisfies ) . toHaveBeenCalledWith ( '2.5.0' , '>=1.0.0' , { loose : true , includePrerelease : true } ) ;
164
164
} ) ;
165
165
} , TIMEOUT ) ;
166
166
it ( 'Test 008 : should check version and munge it a little if it has "rc" in it so it plays nice with semver (introduce a dash in it)' , ( ) => {
167
167
execaSpy . and . returnValue ( Promise . resolve ( { stdout : '3.0.0rc1' } ) ) ;
168
168
return install ( 'android' , project , pluginDir ( 'com.cordova.engine' ) )
169
169
. then ( ( ) => {
170
- expect ( satisfies ) . toHaveBeenCalledWith ( '3.0.0-rc1' , '>=1.0.0' , true ) ;
170
+ expect ( satisfies ) . toHaveBeenCalledWith ( '3.0.0-rc1' , '>=1.0.0' , { loose : true , includePrerelease : true } ) ;
171
171
} ) ;
172
172
} , TIMEOUT ) ;
173
173
it ( 'Test 009 : should check specific platform version over cordova version if specified' , ( ) => {
174
174
execaSpy . and . returnValue ( Promise . resolve ( { stdout : '3.1.0' } ) ) ;
175
175
return install ( 'android' , project , pluginDir ( 'com.cordova.engine-android' ) )
176
176
. then ( ( ) => {
177
- expect ( satisfies ) . toHaveBeenCalledWith ( '3.1.0' , '>=3.1.0' , true ) ;
177
+ expect ( satisfies ) . toHaveBeenCalledWith ( '3.1.0' , '>=3.1.0' , { loose : true , includePrerelease : true } ) ;
178
178
} ) ;
179
179
} , TIMEOUT ) ;
180
180
it ( 'Test 010 : should check platform sdk version if specified' , ( ) => {
181
- const cordovaVersion = require ( '../../package.json' ) . version . replace ( / - d e v | - n i g h t l y . * $ / , '' ) ;
181
+ const cordovaVersion = require ( '../../package.json' ) . version ;
182
182
execaSpy . and . returnValue ( Promise . resolve ( { stdout : '18' } ) ) ;
183
183
return install ( 'android' , project , pluginDir ( 'com.cordova.engine-android' ) )
184
184
. then ( ( ) => {
185
185
expect ( satisfies . calls . count ( ) ) . toBe ( 3 ) ;
186
186
// <engine name="cordova" VERSION=">=3.0.0"/>
187
- expect ( satisfies . calls . argsFor ( 0 ) ) . toEqual ( [ cordovaVersion , '>=3.0.0' , true ] ) ;
187
+ expect ( satisfies . calls . argsFor ( 0 ) ) . toEqual ( [ cordovaVersion , '>=3.0.0' , { loose : true , includePrerelease : true } ] ) ;
188
188
// <engine name="cordova-android" VERSION=">=3.1.0"/>
189
- expect ( satisfies . calls . argsFor ( 1 ) ) . toEqual ( [ '18.0.0' , '>=3.1.0' , true ] ) ;
189
+ expect ( satisfies . calls . argsFor ( 1 ) ) . toEqual ( [ '18.0.0' , '>=3.1.0' , { loose : true , includePrerelease : true } ] ) ;
190
190
// <engine name="android-sdk" VERSION=">=18"/>
191
- expect ( satisfies . calls . argsFor ( 2 ) ) . toEqual ( [ '18.0.0' , '>=18' , true ] ) ;
191
+ expect ( satisfies . calls . argsFor ( 2 ) ) . toEqual ( [ '18.0.0' , '>=18' , { loose : true , includePrerelease : true } ] ) ;
192
192
} ) ;
193
193
} , TIMEOUT ) ;
194
194
it ( 'Test 011 : should check engine versions' , ( ) => {
195
195
return install ( 'android' , project , pluginDir ( 'com.cordova.engine' ) )
196
196
. then ( ( ) => {
197
- const plugmanVersion = require ( '../../package.json' ) . version . replace ( / - d e v | - n i g h t l y . * $ / , '' ) ;
198
- const cordovaVersion = require ( '../../package.json' ) . version . replace ( / - d e v | - n i g h t l y . * $ / , '' ) ;
197
+ const plugmanVersion = require ( '../../package.json' ) . version ;
198
+ const cordovaVersion = require ( '../../package.json' ) . version ;
199
199
expect ( satisfies . calls . count ( ) ) . toBe ( 4 ) ;
200
200
// <engine name="cordova" version=">=2.3.0"/>
201
- expect ( satisfies . calls . argsFor ( 0 ) ) . toEqual ( [ cordovaVersion , '>=2.3.0' , true ] ) ;
201
+ expect ( satisfies . calls . argsFor ( 0 ) ) . toEqual ( [ cordovaVersion , '>=2.3.0' , { loose : true , includePrerelease : true } ] ) ;
202
202
// <engine name="cordova-plugman" version=">=0.10.0" />
203
- expect ( satisfies . calls . argsFor ( 1 ) ) . toEqual ( [ plugmanVersion , '>=0.10.0' , true ] ) ;
203
+ expect ( satisfies . calls . argsFor ( 1 ) ) . toEqual ( [ plugmanVersion , '>=0.10.0' , { loose : true , includePrerelease : true } ] ) ;
204
204
// <engine name="mega-fun-plugin" version=">=1.0.0" scriptSrc="megaFunVersion" platform="*" />
205
- expect ( satisfies . calls . argsFor ( 2 ) ) . toEqual ( [ null , '>=1.0.0' , true ] ) ;
205
+ expect ( satisfies . calls . argsFor ( 2 ) ) . toEqual ( [ null , '>=1.0.0' , { loose : true , includePrerelease : true } ] ) ;
206
206
// <engine name="mega-boring-plugin" version=">=3.0.0" scriptSrc="megaBoringVersion" platform="ios|android" />
207
- expect ( satisfies . calls . argsFor ( 3 ) ) . toEqual ( [ null , '>=3.0.0' , true ] ) ;
207
+ expect ( satisfies . calls . argsFor ( 3 ) ) . toEqual ( [ null , '>=3.0.0' , { loose : true , includePrerelease : true } ] ) ;
208
208
} ) ;
209
209
} , TIMEOUT ) ;
210
210
it ( 'Test 012 : should not check custom engine version that is not supported for platform' , ( ) => {
211
211
return install ( 'blackberry10' , project , pluginDir ( 'com.cordova.engine' ) )
212
212
. then ( ( ) => {
213
213
// Version >=3.0.0 of `mega-boring-plugin` is specified with platform="ios|android"
214
214
expect ( satisfies . calls . count ( ) ) . toBe ( 3 ) ;
215
- expect ( satisfies ) . not . toHaveBeenCalledWith ( jasmine . anything ( ) , '>=3.0.0' , true ) ;
215
+ expect ( satisfies ) . not . toHaveBeenCalledWith ( jasmine . anything ( ) , '>=3.0.0' , { loose : true , includePrerelease : true } ) ;
216
216
} ) ;
217
217
} , TIMEOUT ) ;
218
218
} ) ;
0 commit comments