Package: unittest-jasmine
Jasmineintegration forunittestThis package allows you to runJasmineunit
tests fully integrated with thePythonstandard moduleunittest.The main use case is to runJavaScripttests for Python server APIs.Quick startTo use this module, please follow these steps:Addunittest-jasmineto thetests_requireparameter tosetuptools.setup().Change or add thetest_loaderargument tosetuptools.setup()to'unittest_jasmine.SetuptoolsLoader'.Add yourJasminespecs to your test package, and make sure the file names
end withspec.js.If your project usesnpmto manage dependencies, those will be automatically
updated when the tests are run usingnpm install.Advanced optionsPass additional options tounittest-jasmineby modifying thetest_suiteparameter tosetuptools.setup(); append the character'|'and then
the options separated by';':setuptools.setup(
    . . .
    test_suite='tests|option1=value1;option2={"flag":true}',
    . . .
)The value part of an option may be eitherJSONor a simple string. Anything
that is not parsable asJSONis treated as a simple string. A simple string
is treated as aJSONstring.The following options are recognised byunittest-jasmine:lifecycleA module receiving notifications about the lifecycle of suites and tests.
SeeI need to run Python code before each test or suitefor more
information.spec_regexA regular expression used to find the spec files in the test directory.test_directoryThe directory that contains the spec files. This must be an absolute path.Any option not in this list will be passed on to theJasmineloadConfigmethod.Common tasksMyJasminespecs are not located in the same directory as myPythontestsOverride the default path to the spec files by setting the optiontest_directory. This must be the absolute path to the directory containing
the spec files.MyJasminespec files do not end withspec.jsOverride the regular expression used to filter spec files from the test
directory by setting the optionspec_regex. This is used as a regular
expression to filter the files to include.An example value is:setuptools.setup(
    . . .
    test_suite='tests|spec_regex=.*?-test\\.js',
    . . .
)I need to runPythoncode before each test or suiteSet the optionlifecycleto specify a module with functions handling the
setup and teardown of tests and suites.The functionssuite_setup,suite_teardown,test_setupandtest_teardown, if defined, will be called with the suite or test as
parameter. The functions will be called as instance methods of the respective
suites and tests.You may copy templates for these functions from.../unittest_jasmine/_setuptools.py.An example value is:setuptools.setup(
    . . .
    test_suite='tests|lifecycle=test._jasmine_lifecycle',
    . . .
)I need to loadJasminehelper filesSet the optionhelperto aJSONencoded list of strings. The strings are
interpreted byJasmineas paths to helper files, relative to the directory
containing the spec files; they must not be absolute paths.I have specs written inCoffeeScriptTo enable running tests written inCoffeeScript, first modify the optionspec_regexto ensure that it also includes.coffeefiles, and then make
sure that one of yourJasminehelper files contains the expressionrequire("coffee-script/register"). An example value is:setuptools.setup(
    . . .
    test_suite='tests|spec_regex=.*?spec\\.(js|coffee);helpers=["cs.js"]',
    . . .
)Release notesv1.0.2 - pkg_resources fixesMake sure to actually include theJavaScriptrunner in the package.Use__name__instead of__package__when loading runner usingpkg_resourcesto work onPython 3.v1.0.1 - Python 3 fixesCorrected dynamic method addition to work withPython 3.Allow using release maker script onPython 3.Build a universal wheel when making a release.v1.0 - Initial ReleaseInitial release