-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of requirehelper #1
Comments
I agree that using require_helper doesn't work for this use case. I have the same use case for an express web app thats organized by module and each module has it's own tests (more about this module design pattern with express.js here: http://vimeo.com/56166857). Your solution with Instead, I recommend copying your tests into your coverage folder and running them from there. In the gruntfile.js you can use a variable for the base path of your tests src directory using |
add npm run test to match it with exercise gregjopa#1
In our project we store all test file under test folder near each module instead of /root/test. Also we are using mongoose client for mongodb. So all mongoose models are loaded in server.js/index.js where server is started, so it doesn't make sense to user require_helper in production code.
So we needed a way to tell require to use instrumented file instead on source file without using requireHelper, So we used require.extension. Here is sample code for our requireHelper.js
The text was updated successfully, but these errors were encountered: