@@ -279,11 +279,15 @@ suite("ensureCompatibleDartFrogCLI", () => {
279
279
280
280
suite ( "incompatible CLI" , ( ) => {
281
281
const version = "0.0.0" ;
282
+ const latestVersion = "2.0.0" ;
282
283
283
284
beforeEach ( ( ) => {
284
285
utilsStub . readDartFrogCLIVersion . returns ( version ) ;
285
- utilsStub . isCompatibleDartFrogCLIVersion . returns ( false ) ;
286
- utilsStub . readLatestDartFrogCLIVersion . returns ( version ) ;
286
+ utilsStub . readLatestDartFrogCLIVersion . returns ( latestVersion ) ;
287
+ utilsStub . isCompatibleDartFrogCLIVersion . withArgs ( version ) . returns ( false ) ;
288
+ utilsStub . isCompatibleDartFrogCLIVersion
289
+ . withArgs ( latestVersion )
290
+ . returns ( true ) ;
287
291
} ) ;
288
292
289
293
afterEach ( ( ) => {
@@ -302,6 +306,21 @@ suite("ensureCompatibleDartFrogCLI", () => {
302
306
) ;
303
307
} ) ;
304
308
309
+ test ( "shows warning without update action when latest version is not compatible" , async ( ) => {
310
+ utilsStub . isCompatibleDartFrogCLIVersion
311
+ . withArgs ( latestVersion )
312
+ . returns ( false ) ;
313
+
314
+ await extension . ensureCompatibleDartFrogCLI ( ) ;
315
+
316
+ sinon . assert . calledOnceWithExactly (
317
+ vscodeStub . window . showWarningMessage ,
318
+ `Dart Frog CLI version ${ version } is not compatible with this extension.` ,
319
+ "Changelog" ,
320
+ "Ignore"
321
+ ) ;
322
+ } ) ;
323
+
305
324
test ( "updates CLI when selected" , async ( ) => {
306
325
vscodeStub . window . showWarningMessage . returns ( "Update Dart Frog CLI" ) ;
307
326
@@ -315,7 +334,10 @@ suite("ensureCompatibleDartFrogCLI", () => {
315
334
316
335
await extension . ensureCompatibleDartFrogCLI ( ) ;
317
336
318
- sinon . assert . calledOnceWithExactly ( utilsStub . openChangelog , version ) ;
337
+ sinon . assert . calledOnceWithExactly (
338
+ utilsStub . openChangelog ,
339
+ latestVersion
340
+ ) ;
319
341
sinon . assert . notCalled ( commandsStub . updateCLI ) ;
320
342
} ) ;
321
343
0 commit comments