Skip to content

Commit

Permalink
Fix JS tests & add Travis config
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Nov 17, 2014
1 parent 7753ca3 commit 3899f5c
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
@@ -0,0 +1,7 @@
language: python
python:
- "2.7"

install: ./tests/travis-setup.sh

script: ./tests/travis-test.sh
16 changes: 16 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,16 @@
module.exports = function(grunt) {
'use strict';

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
qunit: {
files: ['tests/runner.html']
}
});

grunt.loadNpmTasks('grunt-contrib-qunit');

// Task to run tests
grunt.registerTask('test', 'qunit');
};
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -11,13 +11,13 @@
},
"devDependencies": {
"assert": "*",
"es5-shim": "^4.0.3",
"grunt": "~0.4.0",
"grunt-cli": "0.1.6",
"grunt-contrib-qunit": "~0.5.1",
"grunt-qunit-cov": "~0.3.6",
"grunt-qunit-junit": "~0.1.0",
"qunitjs": "^1.14.0"
},
"scripts": {
}
"scripts": {}
}
5 changes: 5 additions & 0 deletions tests/runner.html
Expand Up @@ -11,8 +11,13 @@
<script src="../webdiff/static/components/highlightjs/highlight.pack.js"></script>
<link rel="stylesheet" href="../webdiff/static/components/highlightjs/styles/googlecode.css">

<!-- for PhantomJS -->
<script src="../node_modules/es5-shim/es5-shim.min.js"></script>
<script src="../node_modules/es5-shim/es5-sham.min.js"></script>

<script src="../webdiff/static/components/react/react.js"></script>
<script src="../webdiff/static/components/react/JSXTransformer.js"></script>
<script src="../webdiff/static/components/react-router/dist/react-router.js"></script>

<script src="../webdiff/static/codediff.js/difflib.js"></script>
<script src="../webdiff/static/codediff.js/codediff.js"></script>
Expand Down
7 changes: 7 additions & 0 deletions tests/travis-setup.sh
@@ -0,0 +1,7 @@
#!/bin/bash
# Install all deps & build everything for the Python & JS tests.
set -o errexit

pip install -r requirements.txt
npm install
bower install
6 changes: 6 additions & 0 deletions tests/travis-test.sh
@@ -0,0 +1,6 @@
#!/bin/bash
# Run both the Python & JS tests.
set -o errexit

nosetests tests
grunt test --verbose --force

0 comments on commit 3899f5c

Please sign in to comment.