opensoul.org

JSLint and Jasmine

Lucid is a JavaScript framework I am creating which encapsulates ideas from several large JavaScript applications. I’m sure I’ll be writing about it more as it matures, but for now I want to highlight a commit I made tonight.

I’ve been looking for a way to integrate JSLint (or JSHint, a slightly more sane version of JSLint) into the “build process” of my JavaScript-heavy apps, and it recently occurred to me that it should just be part of the test suite.

I’ve been using Jasmine a lot lately, and it was rather trivial to add a spec that runs all my src and spec files through JSHint. Now I can immediately see where I have poor syntax:

javascript and testing February 19, 2011

4 Comments

  1. Justin Searls Justin Searls February 20, 2011

    Hey Brandon, this is a great idea—I’m going to see if I can take a similar approach (of generating a JSLint/JSHint spec) as an optional goal for my jasmine-maven-plugin

    Thanks for sharing it!

  2. Malcolm Locke Malcolm Locke September 14, 2011

    This is great thanks Brandon, exactly what I was after.  Just a quick not that the link to the spec file is broken.

  3. Brandon Keepers Brandon Keepers September 14, 2011

    Malcolm: Thanks for pointing out the broken link. It’s fixed now.

  4. DK Kahn DK Kahn April 27, 2012

    Thanks! Was just watching Douglas Crockford video talking about JS Lint and had the same idea that this would be amazing to run as part of test suite.

Post a Comment

Comments use textile. Anonymous comments will be deleted.

I am Brandon Keepers. I build Internet things, usually with Ruby or JavaScript. I work at GitHub and live in Holland, MI.

Popular Posts