Tests written with nodeunit-dsl seem to always fail #1

Open
abraao opened this Issue Sep 27, 2011 · 0 comments

Projects

None yet

1 participant

@abraao
abraao commented Sep 27, 2011

The method assertionList in nodeunit's type.js has redefined "failures" in its return object as a function rather than a property with a getter. This causes every test written with nodeunit-dsl to seem failed, with the body of said function rendered as the number of failed assertions. Rather than simply accessing assertions.failures, the code should check if it's a function first, and if so, execute it.

The previous version of assertionList defined "failures" as a function that was automatically executed when accessed by using defineGetter . This was changed by caolan on Nov 18, 2010 in favor of the current implementation because getters are not supported by all browsers.

I will submit a pull request with a fix for this issue shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment