Problems with Unit Testing spec 1.0

32 views
Skip to first unread message

Ates Goral

unread,
Jan 29, 2011, 4:06:31 PM1/29/11
to comm...@googlegroups.com
1) > 7.4. ...and an identical "prototype" property.

Given two values a and b, it's a.constructor.prototype and
b.constructor.prototype that need to be compared, not a.prototype and
b.prototype (both undefined, and therefore always equal). Perhaps the
spec should be clear about this.

2) Another issue I've encountered is with assert.throws(). Rhino pukes
out because "throws" is a reserved keyword. I had to revert to
assert.error() instead.

Kris Kowal

unread,
Jan 30, 2011, 4:59:27 PM1/30/11
to comm...@googlegroups.com

These are both bugs, in my opinion, and should be fixed in the next rev.

Kris Kowal

Kris Kowal

unread,
Mar 14, 2011, 2:33:12 PM3/14/11
to comm...@googlegroups.com

I've proposed a rev 1.0.1 for Unit Testing. These are the differences:

http://wiki.commonjs.org/index.php?title=Unit_Testing/1.0.1&action=historysubmit&diff=3293&oldid=3292

The only contentious point is that I've changed "throws" to "error". I
don't think this implies that "throws" should be removed from all
implementations, just that it's deprecated. Basically, implementations
can claim to be both 1.0 and 1.0.1 compliant by supporting both.

Kris Kowal

Irakli Gozalishvili

unread,
Mar 15, 2011, 2:58:14 AM3/15/11
to comm...@googlegroups.com
Hi Kris,

What about `raises` instead of error ?
I think it's pretty commonly used name for that in other js test frameworks, also more descriptive IMO.

Regards
--
Irakli Gozalishvili
Web: http://www.jeditoolkit.com/
Address: 29 Rue Saint-Georges, 75009 Paris, France



Kris Kowal

--
You received this message because you are subscribed to the Google Groups "CommonJS" group.
To post to this group, send email to comm...@googlegroups.com.
To unsubscribe from this group, send email to commonjs+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/commonjs?hl=en.


Kris Kowal

unread,
Mar 15, 2011, 1:54:36 PM3/15/11
to comm...@googlegroups.com, Irakli Gozalishvili
On Mon, Mar 14, 2011 at 11:58 PM, Irakli Gozalishvili <rfo...@gmail.com> wrote:
> Hi Kris,
>
> What about `raises` instead of error ?

Ates and I appear to both instinctively use "error". I don't think
"raises" is significantly better, since the verb/noun in JavaScript is
throw/error, not raise or handle exception. At the very least, it's
not worth the effort to revise the proposal.

Kris Kowal

Ondřej Žára

unread,
Mar 15, 2011, 5:28:41 PM3/15/11
to comm...@googlegroups.com, Ates Goral
2) Another issue I've encountered is with assert.throws(). Rhino pukes
out because "throws" is a reserved keyword. I had to revert to
assert.error() instead.


What exactly is the problem with assert["throws"](), apart from being written in a style inconsistent with other assertions?


O.

 
Reply all
Reply to author
Forward
0 new messages