Skip to content
nzakas edited this page Oct 18, 2011 · 1 revision

Most parts of CSS Lint have unit tests associated with them. Unit tests are written using YUI Test and are required when making contributions to formatters, rules, or the core library. You'll find all of the unit tests in the tests directory.

When you first get the source code, you need to run ant once initially to generate all of the code and the tests. Once you've done that, there are two ways to run the unit tests:

  1. Browser: Locate the testrunner.htm file in the tests directory. Load this into any web browser and click the "Run Tests" button. This executes all tests and prints out the results.
  2. Command Line: Run ant test from the command line to run all tests. When running ant test, this automatically builds the rest of the library, so there's no need to run ant beforehand.

Because CSS Lint is designed to work in any JavaScript environment, tests should be run both in the browser and on the command line to ensure compatibility.

Clone this wiki locally