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
Added a warning feature #189
Conversation
Maybe some sort of more general "skipping" idea (which would print a warning with relevant info)? Something along the lines of:
and a straight This would also allow for |
Hmmm... I like that idea. I'll have a go at it when I get chance. I remember using skips in an nUnit framework (maybe it was jUnit?) and marking tests incomplete too... I'll abandon straightforward warnings in favour of those if I can implement them. |
Yeah it's not a new idea, I got them from Python's unittest2/Python 3's unittest which has pretty nifty skip decorators. I'm sure many other test frameworks have them. (I considered the idea of putting |
Yes, I've thought of that. The obvious interface would be: test("my test", function () {
skip("Test not yet complete");
equal(someFunction(), "foo");
}); But the problem is, what if |
That could be handled with a There might be problems with |
Check out this answer on stackoverflow on adding a QUnit.testSkip = function( testName, callback ) {
QUnit.test(testName + ' (SKIPPED)', function() {
if (typeof callback === "function") {
callback();
}
var li = document.getElementById(QUnit.config.current.id);
QUnit.done(function() {
li.style.background = '#FFFF99';
});
});
};
testSkip = QUnit.testSkip; |
This allows a warning to be thrown by a test at any point using the
warn
function, but the test still counts as a pass. I've found this quite useful to notify myself/others that something needs attention, but hasn't yet had a test implemented for it. For example: