Skip to content

Commit

Permalink
Fix how we test throws
Browse files Browse the repository at this point in the history
  • Loading branch information
wizzymore committed Jul 23, 2022
1 parent d2cfa71 commit f9d7614
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
10 changes: 2 additions & 8 deletions tests/TurboFrameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@
});

it('throws missing partial exception', function () {
$this->assertThrows(
function () {
response()->turboFrame()->toResponse(request());
},
TurboStreamResponseFailedException::class,
'Missing partial: non "remove" Turbo Streams need a partial.'
);
});
response()->turboFrame()->toResponse(request());
})->throws(TurboStreamResponseFailedException::class, 'Missing partial: non "remove" Turbo Streams need a partial.');

it('generates correct generic turbo frame', function () {
$expectedOutput = File::get('tests/responses/turbo-frame/turbo-frame-generic.html');
Expand Down
11 changes: 3 additions & 8 deletions tests/TurboStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@
});

it('throws missing partial exception', function () {
$this->assertThrows(
function () {
response()->turboStream()->toResponse(request());
},
TurboStreamResponseFailedException::class,
'Missing partial: non "remove" Turbo Streams need a partial.'
);
});
response()->turboStream()->toResponse(request());
})
->throws(TurboStreamResponseFailedException::class, 'Missing partial: non "remove" Turbo Streams need a partial.');

it('generates correct turbo stream - append', function () {
$expectedOutput = File::get('tests/responses/turbo-stream/append.html');
Expand Down

0 comments on commit f9d7614

Please sign in to comment.