After my sad and dreadful crap-out on Saturday I've lain low for a few days. I'd like to say that I've rested but alas my work commitments haven't allowed me much rest. So I did the next best thing—made myself much rice & beans, read a few Jeaves and Wooster novels, tried to get my work life into some type of order and started coding JS again.
We'll deal with said JS stuff here.
I've been working on my testing stuff, progress has been a wee bit glacial, but I think that I've got something done.
The main problem is that JS has a lot of functions that aren't strictly functional, they are the equivalent of IO. How do you run unit-tests on an addEvent function. Or a whole series of these functions interacting?
I think that I can see a way to do this [fireEvent() figures prominently I'm afraid], but I'm going to have to think about this. The main thing that I'm going to have to think about is: do I want to make this for just me, or to be potentially useful to others?
This is a somewhat theological thing—I wanted to take [my?] JS in the direction of Java or C++, where we test things at compile time rather than using reflection at runtime. But I haven't got clue one about the right mix yet.
[Strangely I intensively dislike reflection in Java but I'm more than happy to pseudo-overload etc. in JS.]
There are hard choices to be made here, and whatever choices I make will be wrong for some people. Still it's nice to be faced with them.