Open vkadam opened 10 years ago
I would be nice it this can be part of plugin it self. Load instrumented files from instrumented folder while running coverage.
I answered this question in: https://github.com/gregjopa/express-app-testing-demo/issues/1. I think this issue can be closed.
In our project we are not storing test files under one location, those are stored related to each source file. So each module will have its test folder. Also we are using mongoose client. So all our mongoose related model files gets loaded (required) in server.js/index.js. What this means that in test case we do not load model file like
but we load it like
So we can't use requireHandler for loading model as its getting loaded in server.js/index.js
So we needed a way to keep using require instead of requireHandler but still load instrumented file instead of source one, so we updated our require_handler.js to
Basically hook while loading module using require