Skip to content
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

avoid overwriting QUnit.log methods #191

Open
leobalter opened this issue May 18, 2015 · 0 comments
Open

avoid overwriting QUnit.log methods #191

leobalter opened this issue May 18, 2015 · 0 comments

Comments

@leobalter
Copy link

On

QUnit.testStart(function (testDetails) {
QUnit.log = function (details) {
if (!details.result) {
details.name = testDetails.name;
log.push(details);
}
};
});
this could be replaced by:

    QUnit.log(function(details) {
        if (!details.result) {
          log.push(details);
        }
    });

Overwriting a callback method is not recommended on QUnit and you don't need the testStart callback to get the corresponding test name on current versions of QUnit. details.name will be provided it from the assertion log callback, and details.message will contain the assertion's message.

Ref: http://api.qunitjs.com/QUnit.log/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant