@@ -562,6 +562,70 @@ public function getUpdateTests()
562562import './stimulus_bootstrap';
563563import * as Turbo from '@hotwired/turbo';
564564
565+ console.log(Turbo);
566+ EOF
567+ ],
568+ ];
569+
570+ yield 'recipe_changes_with_multiline_string ' => [
571+ ['assets/app.js ' => $ appJsOriginal ],
572+ [
573+ ['file ' => 'assets/app.js ' , 'position ' => 'top ' , 'content ' => "import './bootstrap'; " ],
574+ ],
575+ [
576+ ['file ' => 'assets/app.js ' , 'position ' => 'top ' , 'content ' => "import './stimulus_bootstrap'; \nimport { useIntersection } from 'stimulus-use'; " ],
577+ ],
578+ ['assets/app.js ' => <<<EOF
579+ import './stimulus_bootstrap';
580+ import { useIntersection } from 'stimulus-use';
581+ import * as Turbo from '@hotwired/turbo';
582+
583+ console.log(Turbo);
584+ EOF
585+ ],
586+ ];
587+
588+ yield 'recipe_changes_with_multiline_array ' => [
589+ ['assets/app.js ' => $ appJsOriginal ],
590+ [
591+ ['file ' => 'assets/app.js ' , 'position ' => 'top ' , 'content ' => "import './bootstrap'; " ],
592+ ],
593+ [
594+ ['file ' => 'assets/app.js ' , 'position ' => 'top ' , 'content ' => [
595+ "import './stimulus_bootstrap'; " ,
596+ "import { useIntersection } from 'stimulus-use'; "
597+ ]],
598+ ],
599+ ['assets/app.js ' => <<<EOF
600+ import './stimulus_bootstrap';
601+ import { useIntersection } from 'stimulus-use';
602+ import * as Turbo from '@hotwired/turbo';
603+
604+ console.log(Turbo);
605+ EOF
606+ ],
607+ ];
608+
609+ yield 'recipe_changes_with_complex_multiline_array ' => [
610+ ['assets/app.js ' => $ appJsOriginal ],
611+ [
612+ ['file ' => 'assets/app.js ' , 'position ' => 'top ' , 'content ' => "import './bootstrap'; " ],
613+ ],
614+ [
615+ ['file ' => 'assets/app.js ' , 'position ' => 'top ' , 'content ' => [
616+ "import './stimulus_bootstrap'; " ,
617+ "import { useIntersection } from 'stimulus-use'; " ,
618+ "" ,
619+ " console.log(years['2025'] !== years['0225']); " ,
620+ ]],
621+ ],
622+ ['assets/app.js ' => <<<EOF
623+ import './stimulus_bootstrap';
624+ import { useIntersection } from 'stimulus-use';
625+
626+ console.log(years['2025'] !== years['0225']);
627+ import * as Turbo from '@hotwired/turbo';
628+
565629console.log(Turbo);
566630EOF
567631 ],
0 commit comments