elfs: (Default)
[personal profile] elfs
I've spent all day working with Zombie and Vows and Coffeescript, only to be stuck by one tiny problem. Dear Javascript Developers: "undefined" and "false" are not the same thing. There are javascript environments (see: node.js) that will crap a brick if you try to dereference the undereferencable.

I had to "fix" both FileUploader.js and WebFonts.js to define their namespaces, because Javascript's namespace "discovery" mechanisms suck. (Bless Coffeescript's @module pattern for fixing at least a tiny segment of the problem on browsers.)

Once I got that done, I started hacking my way through the vows problem. It kept crashing. At first, I thought it was the (now believed to be brilliant) Vows/Zombie/Capybara Hack (not to be confused with the Capybara/Zombie runner), but no, it's a bug it JSDom, the DOM library that Zombie runs on top of: it turns out that it's implementation of document.write is broken, and can't handle adding things like dynamic fonts. So despite my fix for WebFonts.js, I won't be running tests with it in-line.

That's okay, so far as it goes, fonts aren't part of the Behavior-driven mindset, but geez, does actually writing a test harness have to be so friggin' difficult?

Oh, as if that weren't trouble enough, this works:

coffee library_load_test.coffee

and this always returns success, even when the above fails:

vows library_load_test.coffee

[Edit: No, the vows version works fine, as long as you delete any compiled versions of your test runner. It privileges compiled copies of your test runner over source copies, even if you specify the source as being more recent! That's freakin' broken behavior and It. Must. Stop.]

Grrr... Sorry, just had to vent.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

elfs: (Default)
Elf Sternberg

December 2025

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 28th, 2025 11:48 am
Powered by Dreamwidth Studios