Changeset 11:07d6db84d127 in pyenvjasmine
- Timestamp:
- Apr 22, 2015, 1:13:33 PM (10 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
README.rst
r8 r11 36 36 37 37 38 Running the tests of this python module:39 -------------------------- --------------38 Running pyenvjasmine tests 39 -------------------------- 40 40 41 To run the tests on this code here (as opposed to *your* JavaScript 42 code you want to test), install this into a virtualenv, install 43 nose and maybe coverage in that virtualenv and then run:: 41 To run the tests on this code here (as opposed to *your* JavaScript code you 42 want to test), install pyenvjasmine and then run:: 44 43 45 44 nosetests --cover-package=pyenvjasmine --cover-erase \ … … 51 50 run:: 52 51 53 nosetests 52 nosetests -c nose.cfg 54 53 55 to run the tests .54 to run the tests from within the pyenvjasmine sources directory. 56 55 57 56 … … 59 58 ------------------ 60 59 61 The easiest way is to put your "specs" (JavaScript tests) into 62 some directory in your code, then in your python tests, add a new 63 TestCase with just one testthat runs all your JavaScript tests.60 The easiest way is to put your "specs" (JavaScript tests) into some directory 61 in your code, then in your python tests, add a new TestCase with just one test 62 that runs all your JavaScript tests. 64 63 65 The simplest solution is to set capture_output to False, so you see 66 the outputfrom the js tests on the console. Something like this::64 The simplest solution is to set capture_output to False, so you see the output 65 from the js tests on the console. Something like this:: 67 66 68 67 import unittest … … 77 76 78 77 79 If you want a more integrated 80 test control, you could set capture_output to True, then parse the test 81 output that is returned from the run() method, withsomething like this::78 If you want a more integrated test control, you could set capture_output to 79 True, then parse the test output that is returned from the run() method, with 80 something like this:: 82 81 82 import unittest 83 from pyenvjasmine.runner import TestRunner 84 85 class JavaScriptTests(unittest.TestCase): 83 86 def test_my_javascript_no_output(self): 84 87 runner = TestRunner(
Note:
See TracChangeset
for help on using the changeset viewer.