There are things called mocks that simulate a filesystem or database or other external API/resource for the purpose of testing.
this post was submitted on 19 Aug 2023
3 points (100.0% liked)
Learn Programming
156 readers
1 users here now
A place to learn programming.
Share free resources here.
Ask questions on heapoverflow.ml
Python docs (tutorial)
Javascript docs (node)
Hard challenges (Project Euler)
founded 2 years ago
MODERATORS
Terms to look up: mocks, dependency injection, integration tests. At the end for a web app, you run a full headless browser under Puppeteer or Selenium to exercise all the site and UI functions. That is considered an end to end test rather than a unit test.
There's unit tests like you've mentioned, but that's only a part of the picture. What you're describing is functional testing. Usually you want the backend unit testing, along with a framework to do API testing, and then frontend testing using browser automation (selenium, gauge, etc) depending on your needs.