Skip to content
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

add no-unsafe-eval percy snapshot #1474

Merged
merged 5 commits into from
Jul 21, 2021
Merged

add no-unsafe-eval percy snapshot #1474

merged 5 commits into from
Jul 21, 2021

Conversation

oshi97
Copy link
Contributor

@oshi97 oshi97 commented Jul 20, 2021

We cannot use testcafe to testcafe to create a no-unsafe-eval test, because
testcafe internals rely on eval.
Instead, this commit adds a percy snapshot which tests the same thing - that
the page loads even with a CSP that disables unsafe-eval.

Note we only guarantee no unsafe-eval's for the SearchBar component.

J=SLAP-1440
TEST=auto

We cannot use testcafe to testcafe to create a no-unsafe-eval test, because
testcafe internals rely on eval.
Instead, this commit adds a percy snapshot which tests the same thing - that
the page loads even with a CSP that disables unsafe-eval.

Note we only guarantee no unsafe-eval's for the SearchBar component.

I pinned our dev dependency of regenerator-runtime to 0.13.1 to be consistent
with the resolution.

J=SLAP-1440
TEST=auto
@coveralls
Copy link

coveralls commented Jul 20, 2021

Coverage Status

Coverage remained the same at 58.822% when pulling 5e54f05 on dev/unsafe-eval-snapshot into 6361dc3 on develop.

@oshi97 oshi97 requested review from yen-tt and cea2aj July 20, 2021 22:33
@oshi97 oshi97 added the WIP Work in progress label Jul 20, 2021
@oshi97 oshi97 removed the WIP Work in progress label Jul 21, 2021
@@ -0,0 +1,32 @@
import puppeteer from 'puppeteer';
import percySnapshot from '@percy/puppeteer';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a difference between using @percy/script (PercyScript setup from theme) vs @percy/puppeteer?

Copy link
Contributor Author

@oshi97 oshi97 Jul 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they've very recently deprecated percyscript https://docs.percy.io/docs/percyscript
percyscript is basically puppetter with some VERY thing wrapping, so it should be incredibly easy to migrate
I mean just looking at the code there's almost no differences besides the boilerplate

Copy link
Member

@cea2aj cea2aj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@oshi97 oshi97 merged commit ddb58c2 into develop Jul 21, 2021
@oshi97 oshi97 deleted the dev/unsafe-eval-snapshot branch July 21, 2021 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants