From xradiograph

JavaScript: Es Lint Dev

General forked from


I’m working on adding mocha/chai unit-tests to the Unittest branch


git checkout Unittest


grunt mocha



tests are inside of tests/mocha/lib/rules or


conversion of original vows tests seen @


I’m working “bottom-up”





I just updated a pull request on the eslint with comments for eslintTester which has explanation about the formatting that should be used to write new tests. Also, the only way right now to run individual tests is to install mocha globally ([@npm install –g mocha@]) and then run tests on individual files (mocha tests/mocha/lib/rules/yourfilename.js). As far as I know, grunt doesn’t support arbitrary command line parameters, so I don’t think there’s a way to do it through grunt. If you REALLY don’t want to install mocha globally, then you can always call local version from node_packages.

While vows tests might’ve been easier to understand, they also took significantly longer to write (just because you had to repeat yourself all the time). That’s what we are trying to fix. I think once you read the comments in eslintTester and look at the few tests that I already converted, it should be pretty clear how to do it.


DRY and convert all unittests to mocha (Issue #397) - checklist of remaining tests to convert



custom harness around mocha/chai

In the master branch,
And the master conversions






See Also





Retrieved from
Page last modified on July 01, 2014, at 09:20 AM