-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
this.skip()
completely broken if html reporter used.
#1760
Comments
what are you trying to accomplish by skipping the hook? |
@boneskull I'm trying skip whole "describe" section. |
@boneskull mocha already has same test, and it is works for reporter "spec". Can you explain me why doesn't work for "html" reporter? |
Looks like you're right. Avoiding async hooks/specs, I was able to replicate in the browser: describe('foo', function () {
before(function() {
this.skip();
});
it('bar', function() {
// test
});
}); From the console:
But in the browser: So seems like it's not being correctly labeled as pending. |
@Kirill89 Are you able to get describe('foo', function () {
it('bar', function() {
this.skip();
});
}); |
@danielstjules I am surprised, but it is also doesn't work. But with another error. |
Thanks for confirming! Both errors are being propagated by the HTML reporter due to it trying to act on a nonexistent err property for the test, since it wasn't correctly marked as pending. Will look into where that regression may have been introduced. Appreciate your help! |
really nice feature this.skip( what I was looking for ) in hooks(before, after, etc). My question: why is that not documented? it there more nice magic features what is not documented? :) |
@danielstjules any chances to get it fixed soon? |
this.skip()
in before
statement seems brokenthis.skip()
completely broken if html reporter used.
Could you change a label? Needs-Feedback -> Bug? |
Problem is with this check Line 158 in 9b1e587
If i change this line to } else if (test.pending || !test.err) { ...then code seems to work. But i'm not sure such hack is correct. Could anyone check why |
This will be fixed by #1945 (comment) |
Thanks for info! |
Still not fixed with 2.4.3. Test from the first message does not shows error on screen, but throw errors to console and mark test as failed in summary. Something become better, but not all. |
You're right - |
It seems to be fixed for |
Demo: https://github.com/Kirill89/mocha-test
Error: TypeError: test.err is undefined (http://localhost:1111/node_modules/mocha/mocha.js:2786)
The text was updated successfully, but these errors were encountered: