You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
var myModel = require('myModule')
but we load it like
var mongoose = require('mongoose');
var myModel = mongoose.model('ModelName');
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
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
The text was updated successfully, but these errors were encountered: