Skip to content

Commit

Permalink
Add Travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-g committed Jul 4, 2014
1 parent 4059ca9 commit 59a9fe0
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
@@ -0,0 +1,16 @@
language: node_js
node_js:
- "0.10"

before_install:
- cd browser-tests

before_script:
- npm install -g mocha

script:
- ./serve-and-test

branches:
only:
- gh-pages
2 changes: 2 additions & 0 deletions README.md
@@ -1,3 +1,5 @@
[![Build Status](https://secure.travis-ci.org/ariatemplates/hashspace-todomvc.png)](http://travis-ci.org/ariatemplates/hashspace-todomvc)

Hashspace TodoMVC
=================

Expand Down
1 change: 1 addition & 0 deletions grunt-cli.js
@@ -0,0 +1 @@
require('./browser-tests/node_modules/grunt').cli();
29 changes: 29 additions & 0 deletions serve-and-test.js
@@ -0,0 +1,29 @@
#!/usr/bin/env node

var http = require('http');
var spawn = require('child_process').spawn;

var finalhandler = require('finalhandler');
var serveStatic = require('serve-static');

var bootServer = function () {
var serve = serveStatic("./");
var server = http.createServer(function(req, res){
var done = finalhandler(req, res)
serve(req, res, done)
});

server.listen(8000);
}

var bootMocha = function () {
var cmd = "node";
var args = ["grunt-cli.js", "test", "--browser=phantomjs", "--gruntfile", "browser-tests/Gruntfile.js"];
var opts = {
stdio : "inherit"
};
spawn(cmd, args, opts);
}

bootServer();
bootMocha();

0 comments on commit 59a9fe0

Please sign in to comment.