Snapshot: If you are testing what your API is supposed to respond with, that’s called a snapshot and libraries like jest have it built in.
Mock: If you are testing how your code handles data that is coming from an external API, then that’s called a mock. We have a sub-folder called something like “/tests/mocks” and they’re just a sampling of different common API responses that my service is expected to handle. A unit test will grab a specific mock data file and process it according to the logic in my system, then the output is examined for accuracy.