title: How to test methods with I/O that require sample files?
body: <p>I'm trying to write a test with jasmine for a typescript method that reads a file and processes it. This method has two steps (outside of reading the file): validating the file and then processing it. I want to test that the method throws an exception when the file is invalid.</p>
  
  <p>For my tests, I need example files to test, so I was wondering what the best practice to generate/store representative test files is. Should I create these by hand and save them with the tests? Should I write something that generates files to test? Write something that generates file data to test? Something else entirely?</p>
  
  <p>From other questions (<a href="https://stackoverflow.com/questions/1528134/unit-testing-file-i-o">Unit Testing File I/O</a>) I can see that I don't need to test the I/O itself, just the method's functionality, but I do need some data to test the method with.</p>