Skip to content

Commit

Permalink
Update processor spec to work with Puppeteer < 20.x
Browse files Browse the repository at this point in the history
  • Loading branch information
abrom committed Oct 11, 2024
1 parent 5f6682e commit 965a47d
Showing 1 changed file with 33 additions and 14 deletions.
47 changes: 33 additions & 14 deletions spec/grover/processor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -802,20 +802,39 @@
HTML
end

it do
expect { convert }.to raise_error do |error|
expect(error).to be_a Grover::JavaScript::PageRenderError
expect(error.message).to eq "Unexpected identifier 'went'\nReally wrong"
expect(error.error_details).to eq [
{
type: 'SyntaxError',
message: "Unexpected identifier 'went'"
},
{
type: 'Error',
message: 'Really wrong'
}
]
if puppeteer_version_on_or_after? '20.0.0'
it do
expect { convert }.to raise_error do |error|
expect(error).to be_a Grover::JavaScript::PageRenderError
expect(error.message).to eq "Unexpected identifier 'went'\nReally wrong"
expect(error.error_details).to eq [
{
type: 'SyntaxError',
message: "Unexpected identifier 'went'"
},
{
type: 'Error',
message: 'Really wrong'
}
]
end
end
else
it do
expect { convert }.to raise_error do |error|
expect(error).to be_a Grover::JavaScript::PageRenderError
expect(error.message).to eq "SyntaxError: Unexpected identifier 'went'\nReally wrong"
expect(error.error_details).to eq [
{
type: 'Error',
message: "SyntaxError: Unexpected identifier 'went'"
},
{
type: 'Error',
message: 'Really wrong'
}
]
end
end
end

Expand Down

0 comments on commit 965a47d

Please sign in to comment.