============
This package 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.
.. contents::
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
============
``unittest_jshint`` was tested with:
- Python 2.6 (unittest2 required)
- Python 2.7
Currently I only test with `Python`_ versions that are used by `Plone`_ so it
just might work for other `Python`_ versions.
``unittest_jshint`` requires ``jshint`` to be in the ``PATH`` or providing
customized environmental variable ``UNITTEST_JSHINT_COMMAND``.
Contributors
============
- `Rok Garbas`_, garbas
.. _`JSHint`: http://www.jshint.com
.. _`gocept.jslint`: http://pypi.python.org/pypi/gocept.jslint
.. _`documentation`: http://www.jshint.com/options/
.. _`Python`: http://www.python.org
.. _`Plone`: http://www.plone.org
.. _`Rok Garbas`: 'http://garbas.si
Metadata
Release files for unittest_jshint 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| unittest_jshint-1.0.tar.gz | 3.7 kB | Without provenance | Details |
Release files / unittest_jshint-1.0.tar.gz
| Download URL | unittest_jshint-1.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0860a858cf44f66e6c3fdfc30486b0743d8f1a970016296265a5280cd5a2cb47
|
|
BLAKE2b-256 checksum How to use checksums |
ec89a16ac4f3529d7c27cada385f36a4bdc3d02e164972ad2862b98d9c149021
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for unittest_jshint 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.