NoseJS

A Nose plugin to run JavaScript tests using Rhino in a Java subprocess.
Download

NoseJS Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • kumar303

NoseJS Tags


NoseJS Description

A Nose plugin to run JavaScript tests using Rhino in a Java subprocess. NoseJS is a Nose plugin to run JavaScript tests using Rhino in a Java subprocess.Usage:Here is the most basic way to invoke NoseJS (assumes you've downloaded Rhino into ~/src)$ nosetests --with-javascript --rhino-jar ~/src/rhino1_7R1/js.jarThis 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.The 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.Here 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:|-- fudge| |-- __init__.py| |-- patcher.py| |-- tests| | |-- __init__.py| | |-- test_fudge.py| | |-- test_patcher.py|-- javascript| |-- fudge| | |-- fudge.js| | |-- tests| | | |-- test_fudge.html| | | `-- test_fudge.js`-- setup.pyBoth Python and JavaScript tests can be run with this command:$ nosetests --with-javascript --rhino-jar ~/src/rhino1_7R1/js.jar --with-dom --js-test-dir javascript/fudge/tests/......................................................----------------------------------------------------------------------Test Fake can find objects can create objects expected call not called call intercepted returns value returns fakeTest ExpectedCall ExpectedCall properties call is loggedTest fudge.registry expected call not called start resets calls stop resets calls global stop global clear expectationsLoaded 6 JavaScript filesOK----------------------------------------------------------------------Ran 54 tests in 0.392sOKThe dots are the Python tests that were run and the output below that is what Fudge's JavaScript test files printed out. Requirements: · Python What's New in This Release: · Multiple paths for the --javascript-dir option can now be specified on multiple lines in setup.cfg


NoseJS Related Software