{ "info": { "author": "UNKNOWN", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [], "description": "NoseJS is a `Nose`_ plugin for integrating JavaScript tests into a Python test suite.\n\n.. _Nose: http://www.somethingaboutorange.com/mrl/projects/nose/\n.. _Rhino: http://www.mozilla.org/rhino/\n\n.. contents::\n\nOverview\n========\n\nNoseJS is designed for Python projects that require JavaScript code for some Web functionality. It currently has two features:\n\n- Discover and run JavaScript tests alongside Python tests\n- Validate JavaScript syntax (check for lint).\n\nInstall\n=======\n\nThere are some optional external dependencies in the sections below.\n\nYou can get NoseJS with `easy_install `_ ::\n \n $ easy_install NoseJS\n\nOr you can clone the source using `Mercurial `_ from http://bitbucket.org/kumar303/nosejs/ and install it with ::\n \n $ python setup.py develop\n\nChecking JavaScript Syntax\n==========================\n\nNoseJS will find JavaScript files (e.g. ``app.js``) along the Nose path and run them through the `jsl`_ command line tool to check for \"lint.\" In other words, show you syntax errors, warnings, etc. You can install jsl on most systems using your package manager (i.e. ``port install javascript-lint`` on Mac OS X) otherwise it is available for download on the `jsl`_ site. \n\n.. _jsl: http://www.javascriptlint.com/\n\nUsage\n-----\n\nTo check for lint without running any JavaScript unit tests, type::\n \n $ nosetests --with-javascript --no-javascript-tests path/to/javascript\n\nTo disable lint checking, add ``--no-javascript-lint``\n\nRunning JavaScript Tests\n========================\n\nNoseJS will also find and run JavaScript test files, those that match Nose's test pattern and end in ``.js``. Currently, NoseJS supports running executing tests in `Rhino`_, a Java implementation of the JavaScript language. There is experimental support for `python-spidermonkey `_ using the ``--spidermonkey`` switch.\n\nUsage\n-----\n\nAssuming you've downloaded `Rhino`_ into ``~/src``, discover and run JavaScript tests with this command::\n \n $ nosetests --with-javascript --rhino-jar ~/src/rhino1_7R1/js.jar path/to/javascript/tests\n\nThis command would look for any files along Nose's path ending in .js that match Nose's current test pattern, collect them all, then execute them using Rhino in a single Java subprocess at the end of all other tests. By default, files looking like ``test*.js`` will be collected and run.\n\nThe idea behind NoseJS is that you might have a Python web application that relies on JavaScript for some of its functionality and you want to run both Python and JavaScript tests with one command, `nosetests `_. You can put these JavaScript tests wherever you want in your project.\n\nHere is a more realistic example that shows how the `Fudge `_ project is tested simultaneously for Python and JavaScript functionality. Its project layout looks roughly like this::\n\n |-- fudge\n | |-- __init__.py\n | |-- patcher.py\n | |-- tests\n | | |-- __init__.py\n | | |-- test_fudge.py\n | | |-- test_patcher.py\n |-- javascript\n | |-- fudge\n | | |-- fudge.js\n | | |-- tests\n | | | |-- test_fudge.html\n | | | `-- test_fudge.js\n `-- setup.py\n\nBoth Python and JavaScript tests can be run with this command::\n \n $ nosetests --with-javascript \\\n --rhino-jar ~/src/rhino1_7R1/js.jar \\\n --with-dom \\\n --javascript-dir javascript/fudge/tests/\n ......................................................\n ----------------------------------------------------------------------\n Test Fake\n can find objects\n can create objects\n expected call not called\n call intercepted\n returns value\n returns fake\n Test ExpectedCall\n ExpectedCall properties\n call is logged\n Test fudge.registry\n expected call not called\n start resets calls\n stop resets calls\n global stop\n global clear expectations\n\n Loaded 6 JavaScript files\n\n OK\n ----------------------------------------------------------------------\n Ran 54 tests in 0.392s\n\n OK\n \nThe dots are the Python tests that were run and the output below that is what Fudge's JavaScript test files printed out. Be sure to read the Caveats section below ;)\n\nSpecifying a path to JavaScript files\n-------------------------------------\n\nIf JavaScript files are nested in a subdirectory, like the above example, specify that directory with::\n \n $ nosetests --with-javascript --javascript-dir javascript/fudge/tests/ --javascript-dir ./another/dir\n\nnosejs JavaScript namespace\n---------------------------\n\nAll JavaScripts have the ``nosejs`` JavaScript namespace available for use. The following methods are available:\n\n- **nosejs.requireFile(path)**\n \n - Load a JavaScript file from your test script. If you require the same file multiple times, it will only \n be loaded once. If the file does not start with a slash, then it should be a path relative to the directory \n of the script where requireFile() was called from. For example, here is how test_fudge.js requires the \n fudge library before testing::\n \n if (typeof nosejs !== 'undefined') {\n nosejs.requireFile(\"../fudge.js\");\n }\n\n- **nosejs.requireResource(name)**\n \n - Require a JavaScript file that is bundled with NoseJS. There are a few available resources:\n \n jquery-1.3.1.js\n Will load the `JQuery `_ library before loading any other tests\n\n jquery/qunit-testrunner.js\n Will load a very minimal set of JavaScript functions for testing. It is a partial implementation of the `QUnit test runner `_ interface. \n Supported methods: module(), test(), equals(), ok(), and expect()\n \n For example, test_fudge.js uses jquery and the testrunner ::\n \n if (typeof nosejs !== 'undefined') {\n nosejs.requireResource(\"jquery-1.3.1.js\");\n nosejs.requireResource(\"jquery/qunit-testrunner.js\");\n nosejs.requireFile(\"../fudge.js\");\n }\n\nUsing the DOM\n-------------\n\nIf your JavaScript under test relies on a browser-like DOM environment, it might still work! Just run::\n \n $ nosetests --with-javascript --with-dom\n\nThis will load a copy of John Resig's `env.js `_ script to simulate a DOM before loading any other JavaScript. There are a few very minor patches made to env.js, marked with @@nosejs in the NoseJS source.\n\nCaveats\n-------\n\n- Currently if JavaScript tests fail, nosetests **will not** indicate failure and its exit status will be unaffected. I can't figure out a clean way to do this. Please get in touch if you'd like to help. \n- In general, JavaScript tests are not very well integrated into Nose.\n\nWait ... Python *and* Java?\n---------------------------\n\n`Rhino`_ is pretty much the only stable, command line oriented implementation of JavaScript I know of and it's well supported by Mozilla. \n\nAlternatively, John J. Lee created a Python binding to the fast `Spider Monkey engine `_, Atul Varma revived it once in a fork on `Google Code `_, and now Paul J. Davis is working on it (in `git `_ and it is released on `PyPI `_). \n\nThere is current experimental support for Python Spidermonkey in NoseJS using the ``--spidermonkey`` option, which switches out the JavaScript engine.\n\nContributing\n============\n\nPlease submit `bugs and patches `_. All contributors will be acknowledged. Thanks!\n\nChangelog\n=========\n\n- 0.9.4\n \n - Multiple paths for the --javascript-dir option can now be specified on multiple lines in setup.cfg\n \n- 0.9.3\n \n - Added --with-javascript-only option to stop execution of any other Nose tests when needed.\n \n- 0.9.2\n \n - **CHANGED**: The --js-test-dir option is now known as --javascript-dir\n - Added experimental support for python-spidermonkey\n - Added JavaScript lint check using the jsl tool\n - Fixed bugs in how custom paths to JavaScript were expanded\n \n- 0.9.1\n \n - Fixed distribution problem\n \n- 0.9\n \n - Initial release\n\nTo Do\n=====\n\n- Better spidermonkey support\n- Distribute a Rhino js.jar with NoseJS\n- Upgrade env.js using git repo", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "NoseJS", "package_url": "https://pypi.org/project/NoseJS/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/NoseJS/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/NoseJS/0.9.4/", "requires_dist": null, "requires_python": null, "summary": "A Nose plugin for integrating JavaScript tests into a Python test suite.", "version": "0.9.4" }, "last_serial": 784810, "releases": { "0.9": [ { "comment_text": "", "digests": { "md5": "702042bd142a00671e06cf467d253877", "sha256": "bac7cd68408a3cf15f5a733f5ab590949c217fa938b95db435ad6468b5c56654" }, "downloads": -1, "filename": "NoseJS-0.9.tar.gz", "has_sig": true, "md5_digest": "702042bd142a00671e06cf467d253877", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47657, "upload_time": "2009-02-15T23:33:53", "url": "https://files.pythonhosted.org/packages/8b/0b/e83b7f9fa7a7cc16826ae999f445a9820a3713d681370063038ec247ff76/NoseJS-0.9.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "8a95acc79fadb93a7f34457b64314792", "sha256": "20c6e774dca946d4e3c8111a7e8dd91eef98025a924f1b2102ac42acafd2c4e4" }, "downloads": -1, "filename": "NoseJS-0.9.1.tar.gz", "has_sig": true, "md5_digest": "8a95acc79fadb93a7f34457b64314792", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47718, "upload_time": "2009-02-16T03:56:18", "url": "https://files.pythonhosted.org/packages/b8/b4/e3a6d8095baf8bf88348efc60b93eaf9d52fdcf8f35a1c85c1f3d6d9688e/NoseJS-0.9.1.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "152854c3bde2cbc2fc558f9918892466", "sha256": "e2045a7158991e677027b43cf9a5b45636bcf25f3928dcce6aaaf31c5dfcf35b" }, "downloads": -1, "filename": "NoseJS-0.9.4-py2.5.egg", "has_sig": true, "md5_digest": "152854c3bde2cbc2fc558f9918892466", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 62310, "upload_time": "2009-09-14T17:08:55", "url": "https://files.pythonhosted.org/packages/8a/1d/5ab99b6137b960bb901750aa14638d91d8cce71ddff8ed16ac9f6b30ceb6/NoseJS-0.9.4-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "904fdb01eba531419e98ab32065c39c5", "sha256": "be15b59f0e38c6dc41ae5819fa0a88bc29ca1c871e6b308dc3a6a8a7479b3063" }, "downloads": -1, "filename": "NoseJS-0.9.4.tar.gz", "has_sig": true, "md5_digest": "904fdb01eba531419e98ab32065c39c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52082, "upload_time": "2009-09-14T17:08:54", "url": "https://files.pythonhosted.org/packages/c1/76/cb74641148504a3484cf0e16cfd229be523c307cea9a787010d89039c097/NoseJS-0.9.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "152854c3bde2cbc2fc558f9918892466", "sha256": "e2045a7158991e677027b43cf9a5b45636bcf25f3928dcce6aaaf31c5dfcf35b" }, "downloads": -1, "filename": "NoseJS-0.9.4-py2.5.egg", "has_sig": true, "md5_digest": "152854c3bde2cbc2fc558f9918892466", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 62310, "upload_time": "2009-09-14T17:08:55", "url": "https://files.pythonhosted.org/packages/8a/1d/5ab99b6137b960bb901750aa14638d91d8cce71ddff8ed16ac9f6b30ceb6/NoseJS-0.9.4-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "904fdb01eba531419e98ab32065c39c5", "sha256": "be15b59f0e38c6dc41ae5819fa0a88bc29ca1c871e6b308dc3a6a8a7479b3063" }, "downloads": -1, "filename": "NoseJS-0.9.4.tar.gz", "has_sig": true, "md5_digest": "904fdb01eba531419e98ab32065c39c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52082, "upload_time": "2009-09-14T17:08:54", "url": "https://files.pythonhosted.org/packages/c1/76/cb74641148504a3484cf0e16cfd229be523c307cea9a787010d89039c097/NoseJS-0.9.4.tar.gz" } ] }