CSSLint / csslint

Automated linting of Cascading Stylesheets
http://csslint.net
Other
4.77k stars 483 forks source link

Migrate to modern test framework #638

Open ideadapt opened 8 years ago

ideadapt commented 8 years ago

The current test setup relies on the now unmaintained YUITest framework. This has some drawbacks. The more practical ones as I've experienced are: I didn't see a way to:

All of these could be achieved by jasmine for example. I setup jasmine on my local machine. Its pretty straight forward and has been a huge win for me :)

Changing all of the existing test code at once would require quiet a bit of an effort. Another way could be to migrate step by step.

cscott commented 8 years ago

Some of this is just a side-effect of the fact that the YUITests are running under Rhino.

FWIW, to "write debug statements to stdout" from within a test, just do something like:

/*global java*/
java.lang.System.err.println("My debug information");

That's not to say that it wouldn't be worth replacing YUITest with mocha or some such.

frvge commented 8 years ago

We're open for improvements. :)

ideadapt commented 8 years ago

Hi @cscott Thanks for the rhino sysout tip.

Can you think of a staged migration? Something like: Only new tests are done with the new framework. And the old ones are migrated step by step.

What framework would you prefer, if any :) ?

cscott commented 8 years ago

It appears that yuitest can run under node: https://github.com/yui/yuitest/wiki/Command-Line-Interface

So, if it were up to me, I'd migrate to npm/package.json/browserify/yuitest first -- getting rid of ant and rhino and replacing them with "nothing" (just some lines in package.json and maybe some helper scripts in scripts/<foo>.js if absolutely necessary, like to generate the changelog).

Then I'd migrate from yuitest to mocha in a second step. mocha is common in the node/npm world and shares a lot of the same concepts with yuitest, so it probably wouldn't be too hard to port.

tape might be another option: it was specifically written to work well with browserify so it would make testing the bundled build in browsers easy.