Automattic / expect.js

Minimalistic BDD-style assertions for Node.JS and the browser.
2.11k stars 209 forks source link

Fix isRegExp bug in some edge cases #35

Closed satazor closed 12 years ago

satazor commented 12 years ago
var s = '' + re; // This fails for the object types mentioned bellow

[object XMLHttpRequestExceptionPrototype]
[object DOMExceptionPrototype]
[object DOMTokenListPrototype]
[object RangePrototype]
[object HTMLAnchorElementPrototype]
[object RangeExceptionPrototype]
[object XPathExceptionPrototype]
[object EventExceptionPrototype]
[object WebKitCSSMatrixPrototype]
[object SVGExceptionPrototype]
[object XMLHttpRequestExceptionPrototype]
[object DOMExceptionPrototype]
[object DOMTokenListPrototype]
[object RangePrototype]
[object HTMLAnchorElementPrototype]
[object RangeExceptionPrototype]
[object XPathExceptionPrototype]
[object EventExceptionPrototype]
[object WebKitCSSMatrixPrototype]
[object SVGExceptionPrototype]
satazor commented 12 years ago

//cc @guille @visionmedia

rauchg commented 12 years ago

That eql thing sux.

satazor commented 12 years ago

Thanks @guille !

rauchg commented 12 years ago

Like, it depends on JSON.

rauchg commented 12 years ago

TooTallNate commented 12 years ago

hahahah

satazor commented 12 years ago

@guille can you bump the package version in npm?

rauchg commented 12 years ago

0.2.0 out, thanks a lot @satazor

0.2.0 / 2012-10-19
==================

  * fix isRegExp bug in some edge cases
  * add closure to all assertion messages deferring costly inspects
    until there is actually a failure
  * fix `make test` for recent mochas
  * add inspect() case for DOM elements
  * relax failure msg null check
  * add explicit failure through `expect().fail()`
  * clarified all `empty` functionality in README example
  * added docs for throwException fn/regexp signatures