Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/Fixture/files/javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ <h1>Timeout Test</h1>
<h1>Console Log Test</h1>
<button id="log-error">log error</button>
<button id="throw-error">throw error</button>
<button id="throw-raw">throw raw</button>
<hr>

<a style="display: none;" href="/page1">invisible link</a>
Expand Down Expand Up @@ -68,6 +69,9 @@ <h1>Console Log Test</h1>
$('#throw-error').click(function() {
throw new Error('error object message');
});
$('#throw-raw').click(function() {
throw 'raw error message';
});
});
</script>
</body>
Expand Down
16 changes: 16 additions & 0 deletions tests/PantherBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,22 @@ public function cannot_follow_invisible_link(): void
;
}

/**
* @test
*/
public function can_dump_console_log_with_throw_raw(): void
{
$output = self::catchVarDumperOutput(function() {
$this->browser()
->visit('/javascript')
->click('throw raw')
->dumpConsoleLog()
;
});

$this->assertStringContainsString('raw error message', \json_encode($output, JSON_THROW_ON_ERROR));
}

protected function browser(): PantherBrowser
{
return $this->pantherBrowser();
Expand Down