I have an asynchronous readFile(path, callback) function.
The very first time it reads a file it will read it from the file system. It will save the content into the memory.
Afterwards when the same file is read it will just return the content from memory instead of hitting the file system again.
The problem I'm having is how to test this that mechanism is working in a test suite since there is no way for the method call to know if the content is returned from the file system or memory.
How can I implement readFile() so it's caching feature is testable?