I have a bit of a weird question: I have a program for scraping data from webpages (just the actual HTML pages, not API responses).
I need to write end-to-end tests for this program with the Jest library. In order to test the functionality consistently, I need to make sure that the referred web pages don't change, which would be almost impossible to achieve with resources on the web.
I wondered how good of a practice it is to spin up a new webserver locally with express/fastify/etc. to serve static HTML pages before running the tests and then shut the server down once the tests pass.
Are there any better ways to achieve what I mentioned? Thank you in advance!