tj / should.js

BDD style assertions for node.js -- test framework agnostic
MIT License
2.75k stars 194 forks source link

Fixes HTMLElement check error in DOM-less environments #173

Closed tonylukasavage closed 10 years ago

tonylukasavage commented 10 years ago

When the check for HTMLElement was relaxed (33331c92834106846196a1bf1c59ee032990ab81), it inadvertently made the should.js browser-compatible version unusable in environments without a DOM. The prior typeof check made it safe. I know, it sounds like a worthless note, but Appcelerator's Titanium was able to make full use of should.js before this commit. Now without a patch of some sort it cannot, ending in undefined exceptions.

I understand that the purpose of the single-file should.js is to support the browser. I humbly request, though, that unless the commit which relaxed the HTMLElement check was critical for some reason I am unaware of, please consider accepting this PR so that the Titanium community can continue using it in its unit testing suites again.

All tests passing.

Sophrinix commented 10 years ago

+1

ricardoalcocer commented 10 years ago

+1

archr commented 10 years ago

+1

timanrebel commented 10 years ago

+1

stephenfeather commented 10 years ago

+1

WooD1k commented 10 years ago

+1

manumaticx commented 10 years ago

+1

rborn commented 10 years ago

+1

rblalock commented 10 years ago

+1.32345

raulriera commented 10 years ago

+1

lele85 commented 10 years ago

+1

mattapperson commented 10 years ago

+1

prpatel commented 10 years ago

+1

tonylukasavage commented 10 years ago

@btd Thanks for the incredibly quick turn-around!

btd commented 10 years ago

No problem, i was curious that so many people affected (i used jsdom in tests with jq and miss it) and only now it become clear. Thank you for fix.