xenial-black
xenial-black•2y ago

How can I use Jest for testing my crawlee scraper on my local machine with different scenarios?

I want to test different scenarios for how the input for the scraper can be used so I can run this test to make sure users do not experience problems.
4 Replies
xenial-black
xenial-blackOP•2y ago
I have for instance at least 5 test scenarios and I want to run this automated with npm run test and as a git pre-commit hook this is quite essential since it is hard to manually make sure all scenarios work as expected and my users experience these breaking issues unfortunately
xenial-black
xenial-blackOP•2y ago
@Oleg V. thanks this seems to be what I was looking for 🙂 @Oleg V. Is it also possible to setup testing inside package.json so I can run tests locally before pushing to apify and potentially causing issues to my users? 🙂
Lukas Krivka
Lukas Krivka•2y ago
Yeah, you can run normal unit tests. We usually run vs HTML snapshot.

Did you find this page helpful?