-
Link /opt/zenoss to your zenhome directory
sudo ln -s <path to>/zenhome /opt/zenoss
-
Open Jasmine/SpecRunner.html in a browser.
file:///<path to>/zenoss-prodbin/tests/jasmine/SpecRunner.html?
Jasmine Spec files should match 1to1 with the code-under-test. If we are testing zenoss/date.js, its spec file will be zenoss/tests/date_spec.js
Source | Spec |
---|---|
source_file.js | source_file_spec.js |
Ext.namespace | describe("Ext.namespace", function() { |
Ext.namespace.method() | it('.method behaves this way', function(){ |
Using relative paths, add the file-under-test and its spec file to SpecRunner
<!-- include source under test -->
<script src="../../Products/ZenUI3/browser/resources/js/zenoss/date.js"></script>
<script src="../../Products/ZenUI3/browser/resources/js/zenoss/Renderers.js"></script>
<!-- include spec files here... -->
<script src="../../Products/ZenUI3/browser/resources/js/zenoss/tests/date_spec.js"></script>
<script src="../../Products/ZenUI3/browser/resources/js/zenoss/tests/renderers_spec.js"></script>
Run your tests by refreshing the jasmine window in your browser.
If need be, add required js source under <!-- include source files here... -->
Its a good idea to run Jasmine with your browser console open, and look for messages that indicate load errors.
Failed to load resource: net::ERR_FILE_NOT_FOUND ... missing_file.js
Deprecation warnings also show up here.