rant: ugh nodejs and npm and test runners

NPM’s search really is awful. Especially on the command-line, it appears to scrape the npmjs.org website and doesn’t seem to cache much. It’s slower than apt-get. I switched to using the web interface to search for packages but then I realized that it has no way of sorting or filtering which means I’m wading through tons of results to weed out the ones that haven’t been updated for months.

That’s how I found grunt-pg which would let me add Grunt tasks for creating PostgreSQL databases and loading up an SQL file into the database. However it’s many months out of date and hasn’t been under any active development. If there were only a way to filter those results out…

The test runners also have problems. Karma seems like a good test runner but it requires a browser. Mocha seems like a good test framework, but it requires a browser. Basically all of the test runners and frameworks require a browser even if it is just the headless browser PhantomJS. I’m glad there’s lots of options for running unit tests on the client-side but what about all those servers that run NodeJS code?

The other thing that’s silly is how many libraries I have to download to get anything done. To get unit tests working on the client-side I need karma, karma-firefox-launcher, karma-jasmine and grunt-karma. For server-side unit testing, I had mocha, chai, sinon and some other module for grunt (there’s more than 5 of them just to run mocha and chai).

I’ve never had this situation with other languages where people are more cooperative and the documentation is better written. For Common Lisp there are some unit testing libraries, but I stuck to a single one, FiveAM and it required only itself. For Python, the unit testing library is part of the language and Django extends the classes with some web-oriented stuff. But in the JS world, I’m stuck with all these interchangeable parts and the glue libraries that make them work together. How many unit testing and utility libraries do you? Why do you need so many plugins for your build system?

At this point, most of these frameworks and libraries should have integrated all of the commonly used plugins because they’re commonly used. For the Scheme language, there’s a set of modules that every implementation includes because they’re so commonly used. I don’t see why there’s such a lovefest for very tiny modules that require tons of other libraries to be useful.

Comments are Closed