Skip to content

Commit

Permalink
Add Javascript test environment
Browse files Browse the repository at this point in the history
- 'tox -e jasmine' invokes JasmineJS test runnner

Related-Issue: #17 #4
  • Loading branch information
travelist committed May 27, 2015
1 parent 39925d9 commit 134717e
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cognitive/app/static/app/cognitive.controller.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// this is just a sample code.
describe("A suite", function() {
it("contains spec with an expectation", function() {
expect(true).toBe(true);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// this is just a sample code.
describe("B suite", function() {
it("contains spec with an expectation", function() {
expect(true).toBe(true);
});
});
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ django-mptt==0.6.1
django-treebeard==2.0
djangorestframework==2.4.4
hamlpy==0.82.2
jasmine==2.3.0
jasmine-core==2.3.4
numpy==1.9.1
pandas==0.15.1
python-dateutil==2.2
pytz==2014.10
PyYAML==3.10
redis==2.10.3
repoze.lru==0.6
scikit-learn==0.15.2
Expand Down
77 changes: 77 additions & 0 deletions spec/javascripts/support/jasmine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

# src_files
#
# Return an array of filepaths relative to src_dir to include before jasmine specs.
# Default: []
#
# EXAMPLE:
#
# src_files:
# - lib/source1.js
# - lib/source2.js
# - dist/**/*.js
#
src_files:
- "cognitive/app/static/app/**/*.[controller|module|service|router].js"

# stylesheets
#
# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
# Default: []
#
# EXAMPLE:
#
# stylesheets:
# - css/style.css
# - stylesheets/*.css
#
stylesheets:
- "cognitive/app/static/css/**/*.css"

# helpers
#
# Return an array of filepaths relative to spec_dir to include before jasmine specs.
# Default: ["helpers/**/*.js"]
#
# EXAMPLE:
#
# helpers:
# - helpers/**/*.js
#
helpers:
- "helpers/**/*.js"

# spec_files
#
# Return an array of filepaths relative to spec_dir to include.
# Default: ["**/*[sS]pec.js"]
#
# EXAMPLE:
#
# spec_files:
# - **/*[sS]pec.js
#
spec_files:
- "cognitive/app/static/app/**/*[Ss]pec.js"

# src_dir
#
# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
# Default: project root
#
# EXAMPLE:
#
# src_dir: public
#
src_dir:

# spec_dir
#
# Spec directory path. Your spec_files must be returned relative to this path.
# Default: spec/javascripts
#
# EXAMPLE:
#
# spec_dir: spec/javascripts
#
spec_dir: ./
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist=py27, py34, pep8
envlist=py27, py34, pep8, jasmine
skipsdist = True

[testenv]
Expand All @@ -12,6 +12,9 @@ commands = python manage.py test
[testenv:pep8]
commands = flake8

[testenv:jasmine]
commands = jasmine-ci

[flake8]

# this rule is for maxlength of line charactors
Expand Down

0 comments on commit 134717e

Please sign in to comment.