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-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
Maybe this could be useful:
https://docs.apify.com/platform/actors/development/deployment/automated-tests
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? 🙂
Yeah, you can run normal unit tests. We usually run vs HTML snapshot.