unittest_jshint

Software Screenshot:
unittest_jshint
Software Details:
Version: 1.0
Upload Date: 14 Apr 15
Developer: Rok Garbas
Distribution Type: Freeware
Downloads: 4

Rating: nan/5 (Total Votes: 0)

unittest_jshint is a tool that integrates JSHint with Python's unittest module. This package was inspired by gocept.jslint.

JSHint is a community-driven tool to detect errors and potential problems in JavaScript code and to enforce your team's coding conventions.

It provides a special JSHintTestCase class that collects JavaScript files (in a configurable manner) and dynamically generates a test method for each file that calls jslint on that file.

Usage

To use it, create a test class like this::

    class MyPackageJSLintTest(unittest_jshint.JSHintTestCase):

        include = (
            'my.package.browser:js',
            'my.package.browser:js/lib',
            )

        options = ( 'curly', 'eqeqeq', )


include is a list of "resource paths" of the form packagename:path (passed to pkg_resources).

exclude can be a list of filenames (without path) that will not be collected.

options is a list of arguments that are passed to JSHint (see its documentation for details). The default value is::

    options = ()

All files ending in .js contained in each of these paths will be collected, and the test class will grow a method named test_< filename >.js.

You can ignore JSHint error by setting ignore on the test class (a list of substrings that are matched against each JHLint output line):

    ignore = (
        "Use a named parameter",
        )

Requirements:

  • Python

Similar Software

Bisect
Bisect

20 Feb 15

QSnipps
QSnipps

12 May 15

EXQUIRES
EXQUIRES

20 Feb 15

Other Software of Developer Rok Garbas

github-collective
github-collective

20 Feb 15

iCalendar
iCalendar

13 Apr 15

Comments to unittest_jshint

Comments not found
Add Comment
Turn on images!