Open DanielSwain opened 7 years ago
These a good suggestions, and improving the jasmine-jquery integration is on the TODO list in the readme. I hesitate to add DJ_JQUERY_URL and DJ_JASMINE_JQUERY_URL to the settings because jQuery and jasmine-jquery are static libraries not every project depends on. If a project uses these libraries they can include them with their static files.
Better explanation around how to use jasmine-jquery is a great idea, and we can leave this issue open until it is included in the readme. Thanks. 😁
The following statement in the ReadMe is not clear as far as local testing: django-jasmine also integrates the jasmine-jquery plugin, that provides a set of custom matchers for jQuery framework and an API for handling HTML fixtures in your specs.
Most of the ReadMe seems to be talking about local display of test results (i.e. when the results are rendered to index.html), so I think that the instructions should address things from this angle.
ALSO, I tried using jasmine-jquery commands in my tests, and they failed, of course, because jasmine-jquery wasn't on my local system. I placed it in my "static/js" folder and placed the following script tag as the last of the {# core files #} in base.html:
<script type="text/javascript" src="{% static 'jasmine-jquery.js' %}"></script>
. This caused an error because I have to reference jQuery in files.json. When I moved the script tag for jasmine-jquery to AFTER the {# source files #}, everything was then found OK.I would suggest the following (where DJ_ stands for django-jasmine):