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
canonical way to debug? #106
Comments
Hm, yes. I remember that it was tricky to get it to run at a all with phantomjs. I didn't manage to have the bundle loaded at that time because that would already run the tests while your browser is opening. It's currently only possible with |
I bet mocha's |
I suppose you could also use a transform to just wrap everything in a function, then call it when ready |
Mocha is run in phantomjs with a console reporter. Go ahead and experiment. I'll happily merge anything that improves the debugging experience. |
I have the following var through = require('through2');
module.exports = function (b, opts) {
function apply() {
var firstChunk = false;
b.pipeline.get('wrap').push(through(function (chunk, enc, next) {
if (!firstChunk) {
this.push('window.mochify = function() {\n');
firstChunk = true;
}
next();
}, function(next) {
this.push('\n};\n');
next();
}));
}
apply();
b.on('reset', apply);
} If I need some direction from here:
|
also not sure of the impact on instrumentation here, if any. to me, losing coverage functionality while debugging is an acceptable tradeoff. |
Wow, cool. Ok, so first of all, I have to explain what brout does: It makes the process.stdout/err streams available in browsers and allows to listen for The What do you think? |
I have this as an npm script |
Is this still relevant? |
There will finally be a better solution for this with the move to headless chrome: #161 |
Mochify |
I couldn't figure this out. Passing the
debug
flag will open the inspector, but I don't have a chance to set breakpoints, because the bundle is not yet loaded.The only way I can debug is if I insert a
debugger
statement in my code.The text was updated successfully, but these errors were encountered: