-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a solution to create/update reference screenshots #5
Conversation
d14a124
to
d285a73
Compare
pixelpact/src/render.test.js
Outdated
it("screenshot takes a screenshot of the given url", async () => { | ||
await renderer.start(); | ||
|
||
const screenshot = await renderer.screenshot("https://ergon.ch"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test will fail if ergon.ch
website is down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm not 100% happy with this test case, but since the renderer accepts an URL, this was the easiest thing to get it to green. The safe way to do it would be to spin up a local server and use this url instead - however, this would make the test much more complex. I think for now, it's fine to ignore this, ok?
pixelpact/src/helpers.js
Outdated
@@ -0,0 +1,4 @@ | |||
export function getLocalAddress(fastifyInstance) { | |||
let address = fastifyInstance.addresses().find((e) => e.family === "IPv4"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let address = fastifyInstance.addresses().find((e) => e.family === "IPv4"); | |
const address = fastifyInstance.addresses().find((e) => e.family === "IPv4"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
address
can potentially be undefined
. I think we need to check for the undefined
case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will throw here an explicit exception if address
is undefined
332e2e7
to
b27896e
Compare
No description provided.