@@ -105,7 +105,7 @@ describe('Unit: resolveVersion', function () {
105
105
} ) ;
106
106
107
107
it ( 'filters out 2.0 version if v1 param is specified' , function ( ) {
108
- stubYarn ( '{"data": ["1.0.0", "1.0.1", "1.52.37", "2.0.0"]}' ) ;
108
+ stubYarn ( '{"data": ["1.0.0", "1.0.1", "1.52.37", "2.0.0", "2.0.1" ]}' ) ;
109
109
110
110
return resolveVersion ( null , null , true ) . then ( function ( version ) {
111
111
expect ( version ) . to . equal ( '1.52.37' ) ;
@@ -126,7 +126,7 @@ describe('Unit: resolveVersion', function () {
126
126
} ) ;
127
127
128
128
it ( 'filters out 2.0 version if v1 param is specified' , function ( ) {
129
- stubYarn ( '{"data": ["1.0.0", "1.0.1", "1.52.37", "2.0.0"]}' ) ;
129
+ stubYarn ( '{"data": ["1.0.0", "1.0.1", "1.52.37", "2.0.0", "2.0.1" ]}' ) ;
130
130
131
131
return resolveVersion ( null , '1.52.37' , true ) . then ( function ( ) {
132
132
throw new Error ( 'Version finder should not have resolved' ) ;
@@ -146,7 +146,7 @@ describe('Unit: resolveVersion', function () {
146
146
147
147
describe ( 'jump to next major' , function ( ) {
148
148
it ( 'throws error if you aren\'t on the latest v1' , function ( ) {
149
- stubYarn ( '{"data": ["1.23.0", "1.24.0", "1.25.0", "2.0.0"]}' ) ;
149
+ stubYarn ( '{"data": ["1.23.0", "1.24.0", "1.25.0", "2.0.0", "2.0.1" ]}' ) ;
150
150
151
151
return resolveVersion ( null , '1.24.0' , false ) . then ( function ( ) {
152
152
throw new Error ( 'Version finder should not have resolved' ) ;
@@ -157,34 +157,43 @@ describe('Unit: resolveVersion', function () {
157
157
} ) ;
158
158
159
159
it ( 'resolves if you are on the latest v1' , function ( ) {
160
- stubYarn ( '{"data": ["1.23.0", "1.25.1", "1.25.2", "2.0.0"]}' ) ;
160
+ stubYarn ( '{"data": ["1.23.0", "1.25.1", "1.25.2", "2.0.0", "2.0.1" ]}' ) ;
161
161
162
162
return resolveVersion ( null , '1.25.2' , false )
163
163
. then ( function ( version ) {
164
- expect ( version ) . to . eql ( '2.0.0 ' ) ;
164
+ expect ( version ) . to . eql ( '2.0.1 ' ) ;
165
165
} ) ;
166
166
} ) ;
167
167
168
168
it ( 'resolves using `--v1` and you are\'t on the latest v1' , function ( ) {
169
- stubYarn ( '{"data": ["1.23.0", "1.25.1", "1.25.2", "2.0.0"]}' ) ;
169
+ stubYarn ( '{"data": ["1.23.0", "1.25.1", "1.25.2", "2.0.0", "2.0.1" ]}' ) ;
170
170
171
171
return resolveVersion ( null , '1.25.1' , true )
172
172
. then ( function ( version ) {
173
173
expect ( version ) . to . eql ( '1.25.2' ) ;
174
174
} ) ;
175
175
} ) ;
176
176
177
+ it ( 'updates to latest v2 with many v2 releases' , function ( ) {
178
+ stubYarn ( '{"data": ["1.23.0", "1.25.1", "1.25.2", "2.0.0", "2.1.0", "2.2.0"]}' ) ;
179
+
180
+ return resolveVersion ( null , '1.25.2' , false , false )
181
+ . then ( function ( version ) {
182
+ expect ( version ) . to . eql ( '2.2.0' ) ;
183
+ } ) ;
184
+ } ) ;
185
+
177
186
it ( 'force updating and you are on the latest v1' , function ( ) {
178
- stubYarn ( '{"data": ["1.23.0", "1.25.1", "1.25.2", "2.0.0"]}' ) ;
187
+ stubYarn ( '{"data": ["1.23.0", "1.25.1", "1.25.2", "2.0.0", "2.0.1" ]}' ) ;
179
188
180
189
return resolveVersion ( null , '1.25.2' , false , true )
181
190
. then ( function ( version ) {
182
- expect ( version ) . to . eql ( '2.0.0 ' ) ;
191
+ expect ( version ) . to . eql ( '2.0.1 ' ) ;
183
192
} ) ;
184
193
} ) ;
185
194
186
195
it ( 'force updating with `--v1`' , function ( ) {
187
- stubYarn ( '{"data": ["1.23.0", "1.25.1", "1.25.2", "2.0.0"]}' ) ;
196
+ stubYarn ( '{"data": ["1.23.0", "1.25.1", "1.25.2", "2.0.0", "2.0.1" ]}' ) ;
188
197
189
198
return resolveVersion ( null , '1.25.1' , true , true )
190
199
. then ( function ( version ) {
0 commit comments