5 ms·
Here is how I handle it 1) Write a test that runs the service and saves output to a file. 2) Mock out the call to just return the data from the file and valid
by mohaine 9y ago
Here is how I handle it
1) Write a test that runs the service and saves output to a file.
2) Mock out the call to just return the data from the file and validate results.
3) If you need variations on this data just modify the file/data (often as part of the test)
I usually leave number 1 in the code but disabled since it often relies on remote data that may not be stable. Having the test run more than once is not very beneficial but being able to run it later and see what exactly has changed is great.