Skip to content

Commit

Permalink
more readable console errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Jan 19, 2024
1 parent d1a28a3 commit 22fb625
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Components/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function raiseConsoleErrorOrException(BundlingFailedException $e)

return <<< HTML
<!--[BUNDLE: {$this->as} from '{$this->module}']-->
<script data-bundle="{$this->module}">throw 'BUNDLING ERROR: import {$this->module} as {$this->as}'</script>
<script data-bundle="{$this->module}">throw "BUNDLING ERROR: No module found at path '{$this->module}'"</script>
<!--[ENDBUNDLE]>-->
HTML;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Browser/ComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,6 @@ public function it_logs_console_errors_when_debug_mode_disabled()
HTML)
->assertScript(<<< 'JS'
document.querySelector('script[data-bundle="~/nonexistent-module"').innerHTML
JS, "throw 'BUNDLING ERROR: import ~/nonexistent-module as foo'");
JS, 'throw "BUNDLING ERROR: No module found at path \'~/nonexistent-module\'"');
}
}
2 changes: 1 addition & 1 deletion tests/Feature/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
expect($component->render())
->toContain(
'throw',
'BUNDLING ERROR: import ~/foo as bar'
"BUNDLING ERROR: No module found at path '~/foo'"
)
->not->toThrow(BundlingFailedException::class);
});
Expand Down

0 comments on commit 22fb625

Please sign in to comment.