File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ public function register(): void
1919 public function boot (): void
2020 {
2121 $ this ->publishes ([
22- __DIR__ .'/../resources/js/theme-switch-two-states/theme- init.js ' => resource_path ('js/theme-switch-two-states/theme- init.js ' ),
23- __DIR__ .'/../resources/js/theme-switch-two-states/theme- switch.js ' => resource_path ('js/theme-switch-two-states/theme- switch.js ' ),
22+ __DIR__ .'/../resources/js/theme-switch-two-states/init-script .js ' => resource_path ('js/theme-switch-two-states/init-script .js ' ),
23+ __DIR__ .'/../resources/js/theme-switch-two-states/switch-script .js ' => resource_path ('js/theme-switch-two-states/switch-script .js ' ),
2424 ], ['theme-switch-2-states-js ' , 'theme-switch-2-states-all ' ]);
2525
2626 $ this ->publishes ([
Original file line number Diff line number Diff line change 7979
8080 expect ($ expectedJsPublishes )->not ->toBeEmpty ();
8181
82- // Check specific JS files are published
82+ // Check that the specific physical JS files are published and exist
8383 $ sourceFiles = array_keys ($ expectedJsPublishes );
84- $ jsInitFile = collect ($ sourceFiles )->first (fn ($ file ) => str_contains ($ file , 'theme- init.js ' ));
85- $ jsSwitchFile = collect ($ sourceFiles )->first (fn ($ file ) => str_contains ($ file , 'theme- switch.js ' ));
84+ $ jsInitFile = collect ($ sourceFiles )->first (fn ($ file ) => str_contains ($ file , 'init-script .js ' ));
85+ $ jsSwitchFile = collect ($ sourceFiles )->first (fn ($ file ) => str_contains ($ file , 'switch-script .js ' ));
8686
8787 expect ($ jsInitFile )->not ->toBeNull ()
8888 ->and ($ jsSwitchFile )->not ->toBeNull ();
89+
90+ // Verify that the source files actually exist physically
91+ expect (file_exists ((string ) $ jsInitFile ))->toBeTrue ('init-script.js source file must exist ' )
92+ ->and (file_exists ((string ) $ jsSwitchFile ))->toBeTrue ('switch-script.js source file must exist ' );
8993});
9094
9195test ('boot method publishes theme-switch-two-states JS test files ' , function (): void {
You can’t perform that action at this time.
0 commit comments