Skip to content

Commit

Permalink
Merge pull request #18 from gwleuverink/wip-docs
Browse files Browse the repository at this point in the history
docs & some boyscouting
  • Loading branch information
gwleuverink committed Sep 2, 2024
2 parents 673108d + 06e6fab commit 2987dbf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 3 additions & 5 deletions docs/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ There are a couple of commands at your disposal:

`artisan bundle:build` Scan all your build_paths configured in `config/bundle.php` & compile all your imports.

You may configure what paths are scanned by publishing the Bundle config file and updating the `build_paths` array. Note this config option accepts an array of paths.
You can configure what paths are scanned by publishing the Bundle config file and updating the `build_paths` array. Note this config option accepts an array of paths.

```php
'build_paths' => [
Expand All @@ -184,12 +184,10 @@ You may configure what paths are scanned by publishing the Bundle config file an

## Testing fake

When writing Unit or Feature tests in your application you don't need Bundle to process & serve your imports.

Simply use the BundleManager fake in your test setup. Perfect for when you're asserting on responses with feature tests.
When writing Unit or Feature tests in your application you don't need Bundle to process & serve your imports. You may use the BundleManager fake in your test setup. When testing responses your imports won't be bundled.

```php
BundleManager::fake();
```

When you'd like to use Dusk for browser testing you need to run Bundle in order for your tests not to blow up. Simply don't fake the BundleManager in your DuskTestCase.
If you'd like to use Dusk for browser testing you probably need do to run Bundle. You can assert on any script that depends on a Bundle import. In fact, that's how most of Bundle itself is tested internally.
2 changes: 0 additions & 2 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ class ServiceProvider extends BaseServiceProvider
{
public function boot(): void
{
$this->mergeConfigFrom(__DIR__ . '/../config/bundle.php', 'bundle');

// Only when using locally
if (! $this->app->environment(['local', 'testing'])) {

Expand Down
5 changes: 5 additions & 0 deletions tests/DuskTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ protected function setUp(): void

$this->artisan('view:clear');
$this->artisan('bundle:clear');

// Workaround Testbench Dusk issue dropping registered config (since v9)
config([
'bundle' => require __DIR__ . '/../config/bundle.php',
]);
}

protected function tearDown(): void
Expand Down

0 comments on commit 2987dbf

Please sign in to comment.