I'm currently in the process of simplifying the JS Test Harness. The end goal is to only have to include a single js file. <script src="path/to/test.js"></script> <script> shouldBeTrue('true'); </script> Here are a few things that needs to be done * Remove pre+post scripts. Today we have js-test-pre.js, js-test-post.js, js-test-post-async.js and js-test-function.js. * Remove the need to manually set successfullyParsed to true * Remove the link to include js-test-style.css * Standardize/simplify async tests Right now there are so many ad-hoc ways of doing tests which makes both writing and maintaing tests a real nightmare.
I forgot to mention * Remove #console and #description elements
As discussed on webkit-dev a few weeks ago, I don't really think that making the harness more dynamic and complicated for the sake of reducing boilerplate helps much. One will still most likely use make-new-script-test script or copy/paste, but there are now more points of failure for the engine, and more invisible things to keep in mind when writing tests. That's only a personal opinion/vote, and doesn't seem like something that can be meaningfully discussed.
One of the main problems (IMO) is that having a boiler plate leaves too much room for ad-hoc testing. By making it simpler to do the right thing I believe that we will get less ad hoc tests which leads to better maintainability.
FWIW, even after the handful of cleanups Erik has done so far, I find writing tests much easier. Even without getting rid of js-test-post, I'm finding it tolerable to write them manually now.
Another strange thing is that the description element is a p element and we append a span with more p elements in it which is kind of silly. We should probably just make the description element a div.