-
Notifications
You must be signed in to change notification settings - Fork 20
Testing With Jasmine.py Setup
##Jasmine Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, Node.js projects, or anywhere that JavaScript can run.
####Jasmine...For Python! The Jasmine Python package contains helper code for developing Jasmine projects for Python-based web projects (Django, Flask, etc.) or for JavaScript projects where Python is a welcome partner. It serves up a project's Jasmine suite in a browser so you can focus on your code instead of manually editing script tags in the Jasmine runner HTML file.
##Installation ###First install Jamsmin.js To install Jasmine on your local box:
- Clone Jasmine - git clone https://github.com/pivotal/jasmine.git
- Create a Jasmine directory in your project - mkdir my-project/jasmine
- Move latest dist to your project directory - mv jasmine/dist/jasmine-standalone-2.1.3.zip my-project/jasmine
Note: At the time of this post jasmine-stanalone-2.1.3 is the most recent.
- Change directory - cd my-project/jasmine
- Unzip the dist - unzip jasmine-standalone-2.1.3.zip
###Now install Jasmine python egg
- Install Jasmine python egg:
pip install jasmine
- Setup your specs. From the directory that contains your
app.py
file run:
jasmine-install
This creates the following:
/spec/javascripts/**
/spec/javascripts/suport/jasmine.yml
##Editing YAML
Open /spec/javascripts/suport/jasmine.yml