forked from CSSLint/csslint
-
Notifications
You must be signed in to change notification settings - Fork 0
Unit Tests
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:
-
Browser: Locate the
testrunner.htm
file in thetests
directory. Load this into any web browser and click the "Run Tests" button. This executes all tests and prints out the results. -
Command Line: Run
ant test
from the command line to run all tests. When runningant test
, this automatically builds the rest of the library, so there's no need to runant
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.