Giter Site home page Giter Site logo

django-jasmine's People

Contributors

adrienlemaire avatar ameliatester avatar bcooksey avatar boundsj avatar grigi avatar jakeharding avatar kosz85 avatar tonythomas01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

django-jasmine's Issues

Support a jasmine.yml file.

Investigate if the jasmine.yml will be able to replace the files.json and support test files in separate directories.

Integration of jasmine-jquery into django-jasmine

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):

  1. In settings.py: DJ_JQUERY_URL and then use this variable in base.html to automatically include jQuery (ideally this would be parsed so that it could be either a url within the folder structure or a CDN url if not using jQuery locally). If jasmine-jquery is being included automatically, then it seems like jQuery should be also.
  2. Explain that jasmine-jquery has to be downloaded separately if testing is being done locally.
  3. in settings.py: DJ_JASMINE_JQUERY_URL -- this is the location on the local system to which jasmine-jquery has been copied.

Test files not being found

I have urls set up:
url(r'^jtests/', include('django_jasmine.urls')),

and the following in settings.py:
STATIC_URL = '/static/'
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
JASMINE_TEST_DIRECTORY = os.path.join(BASE_DIR, '../tests_jasmine')
(For now the tests are in a directory that is one level above the BASE_DIR.)

The following shows the incorrect script tag that appears in index.html:
image

Since your instructions say that the tests are to be inside a folder named 'spec', which is to be inside the JASMINE_TEST_DIRECTORY, I don't understand why /spec is not part of the above url for the script tag (not to mention the fact that the urls prefix [in my case jtests] is also included in the url). Also, if the tests can be located in any folder that is designated by JASMINE_TEST_DIRECTORY, then why do the instructions say that the STATIC_URL must be defined in settings? I can see that it could be a problem having the tests located one level above the BASE_DIR, but it seems like the urls qualifier shouldn't be in the script tag.
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.