Skip to content

Commit

Permalink
updated travisci set up
Browse files Browse the repository at this point in the history
  • Loading branch information
mau11 committed Jan 14, 2017
1 parent 5ce2431 commit d43dda2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
language: node_js
node_js:
- "stable"
- "6"
- "6.1"
- "5.11"
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# emanie
[![Build Status](https://travis-ci.org/mau11/emanie.svg?branch=master)](https://travis-ci.org/mau11/emanie)

# emanie
6 changes: 4 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ app.post('/api/photo',function(req,res){
});
});

/*

// Set up db connection
var connection = mysql.createConnection({
host: 'localhost',
Expand All @@ -66,7 +66,7 @@ connection.query(newProfilesTable, function(err, rows){
throw err;
}
});
*/

// Set default pattern count for each user to 0, only do this once
/*var setDefaultPattCt = "ALTER TABLE profiles ALTER pattCt SET DEFAULT 0";
connection.query(setDefaultPattCt, function(err, rows){
Expand Down Expand Up @@ -242,3 +242,5 @@ app.delete('/api/user/patt/:identifier', function(req, res){
app.listen(port, function(){
console.log('Listening on port: ' + port);
});

module.exports = app;
20 changes: 16 additions & 4 deletions serverTests/test/serverTests.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
var app = require('../../server.js');
var request = require('supertest')(app);
var should = require('should');
var supertest = require('supertest');
var server = supertest.agent('http://localhost:8080');
var expect = require('chai').expect;

// Start up server prior to running test.
describe('server',function(){
it('should connect to server', function(done){
server
request
.get('/')
.expect(200)
.end(function(err,res){
Expand All @@ -14,3 +14,15 @@ describe('server',function(){
});
});
});

describe('database',function(){
it('should pull all users from profiles table', function(done){
request
.get('/update')
.expect(200)
.end(function(err,res){
res.status.should.equal(200);
done();
});
});
});

0 comments on commit d43dda2

Please sign in to comment.