Skip to content

Commit

Permalink
Added configuration for mocha tests. Added configuration for test cov…
Browse files Browse the repository at this point in the history
…erage. Added a device base class.
  • Loading branch information
mdobson committed Jun 24, 2014
1 parent 5f3e011 commit 195640d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
21 changes: 21 additions & 0 deletions bin/_coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

if [ $(which jscoverage) ]
then
echo "Running test coverage..."
rm -rf ./zetta-runtime-HEAD
rm -rf ./zetta-runtime-jscoverage
git archive --format=tar --prefix=zetta-runtime-HEAD/ HEAD | tar x
jscoverage --exclude=node_modules ./zetta-runtime-HEAD ./zetta-runtime-jscoverage
cd ./zetta-runtime-jscoverage/
npm install
mocha --reporter html-cov > coverage.html
open coverage.html
else
echo "jscoverage is not installed"
echo "if on OS X:"
echo " use brew install jscoverage"
echo "if on linux:"
echo " use sudo apt-get install jscoverage"
fi

6 changes: 6 additions & 0 deletions device.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var uuid = require('node-uuid');

var Device = module.exports = function(){
this.id = uuid.v4();
};

7 changes: 7 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var assert = require('assert');

describe('Hello', function() {
it('should be fine. 1==1', function() {
assert.equal(1, 1);
});
});

0 comments on commit 195640d

Please sign in to comment.