@@ -562,6 +562,7 @@ const deleteDefaultEnvironment = async (tmpDir: string): Promise<void> => {
562562
563563describe ( 'removeDuplicatedPlugins' , ( ) => {
564564 let capturedPlugins : Map < string , any > | undefined
565+ let outputMock : ReturnType < typeof mockAndCaptureOutput >
565566
566567 class PluginTestCommand extends MockCommand {
567568 async init ( ) {
@@ -583,6 +584,8 @@ describe('removeDuplicatedPlugins', () => {
583584
584585 beforeEach ( ( ) => {
585586 capturedPlugins = undefined
587+ outputMock = mockAndCaptureOutput ( )
588+ outputMock . clear ( )
586589 } )
587590
588591 test ( 'removes @shopify/app plugin when present' , async ( ) => {
@@ -606,6 +609,11 @@ describe('removeDuplicatedPlugins', () => {
606609 expect ( capturedPlugins . has ( '@shopify/plugin-ngrok' ) ) . toBe ( true )
607610 expect ( capturedPlugins . has ( '@shopify/plugin-did-you-mean' ) ) . toBe ( true )
608611 expect ( capturedPlugins . size ) . toBe ( 2 )
612+
613+ // Verify warning was shown
614+ expect ( outputMock . output ( ) ) . toMatch ( / U n s u p p o r t e d p l u g i n s d e t e c t e d .* @ s h o p i f y \/ a p p / s)
615+ expect ( outputMock . output ( ) ) . toMatch ( / s h o p i f y p l u g i n s r e m o v e @ s h o p i f y \/ a p p / )
616+ expect ( outputMock . output ( ) ) . not . toMatch ( / s h o p i f y p l u g i n s r e m o v e @ s h o p i f y \/ p l u g i n - c l o u d f l a r e / )
609617 } )
610618 } )
611619
@@ -630,6 +638,11 @@ describe('removeDuplicatedPlugins', () => {
630638 expect ( capturedPlugins . has ( '@shopify/plugin-ngrok' ) ) . toBe ( true )
631639 expect ( capturedPlugins . has ( '@shopify/plugin-did-you-mean' ) ) . toBe ( true )
632640 expect ( capturedPlugins . size ) . toBe ( 2 )
641+
642+ // Verify warning was shown
643+ expect ( outputMock . output ( ) ) . toMatch ( / U n s u p p o r t e d p l u g i n s d e t e c t e d .* @ s h o p i f y \/ p l u g i n - c l o u d f l a r e / s)
644+ expect ( outputMock . output ( ) ) . toMatch ( / s h o p i f y p l u g i n s r e m o v e @ s h o p i f y \/ p l u g i n - c l o u d f l a r e / )
645+ expect ( outputMock . output ( ) ) . not . toMatch ( / s h o p i f y p l u g i n s r e m o v e @ s h o p i f y \/ a p p / )
633646 } )
634647 } )
635648
@@ -657,6 +670,11 @@ describe('removeDuplicatedPlugins', () => {
657670 expect ( capturedPlugins . has ( '@shopify/plugin-ngrok' ) ) . toBe ( true )
658671 expect ( capturedPlugins . has ( '@shopify/plugin-did-you-mean' ) ) . toBe ( true )
659672 expect ( capturedPlugins . size ) . toBe ( 2 )
673+
674+ // Verify warning was shown with both plugins
675+ expect ( outputMock . output ( ) ) . toMatch ( / U n s u p p o r t e d p l u g i n s d e t e c t e d .* @ s h o p i f y \/ a p p .* @ s h o p i f y \/ p l u g i n - c l o u d f l a r e / s)
676+ expect ( outputMock . output ( ) ) . toMatch ( / s h o p i f y p l u g i n s r e m o v e @ s h o p i f y \/ a p p / )
677+ expect ( outputMock . output ( ) ) . toMatch ( / s h o p i f y p l u g i n s r e m o v e @ s h o p i f y \/ p l u g i n - c l o u d f l a r e / )
660678 } )
661679 } )
662680
@@ -681,6 +699,9 @@ describe('removeDuplicatedPlugins', () => {
681699 expect ( capturedPlugins . has ( '@shopify/plugin-ngrok' ) ) . toBe ( true )
682700 expect ( capturedPlugins . has ( '@shopify/plugin-did-you-mean' ) ) . toBe ( true )
683701 expect ( capturedPlugins . has ( 'some-other-plugin' ) ) . toBe ( true )
702+
703+ // Verify no warning was shown
704+ expect ( outputMock . output ( ) ) . toBe ( '' )
684705 } )
685706 } )
686707
@@ -694,6 +715,9 @@ describe('removeDuplicatedPlugins', () => {
694715
695716 // Then - verify map is still empty
696717 expect ( capturedPlugins . size ) . toBe ( 0 )
718+
719+ // Verify no warning was shown
720+ expect ( outputMock . output ( ) ) . toBe ( '' )
697721 } )
698722 } )
699723
@@ -729,6 +753,10 @@ describe('removeDuplicatedPlugins', () => {
729753 expect ( remainingPlugin . version ) . toBe ( '2.0.0' )
730754 expect ( remainingPlugin . type ) . toBe ( 'user' )
731755 expect ( remainingPlugin . root ) . toBe ( '/path/to/theme' )
756+
757+ // Verify warning was shown
758+ expect ( outputMock . output ( ) ) . toMatch ( / U n s u p p o r t e d p l u g i n s d e t e c t e d .* @ s h o p i f y \/ a p p / s)
759+ expect ( outputMock . output ( ) ) . toMatch ( / s h o p i f y p l u g i n s r e m o v e @ s h o p i f y \/ a p p / )
732760 } )
733761 } )
734762} )
0 commit comments