Skip to content
Permalink
Browse files

Enable Travis and mocha.

  • Loading branch information...
ashlux committed Jan 14, 2017
1 parent 931c70b commit 49bd3de31fe8f00953b996d23856bdfbf6d1cbe2
Showing with 58 additions and 16 deletions.
  1. +5 −0 .babelrc
  2. +6 −9 .travis.yml
  3. +1 −1 README.md
  4. +13 −6 package.json
  5. +6 −0 test/mocha.opts
  6. +27 −0 test/setup.js
@@ -0,0 +1,5 @@
{
"presets": [
"es2015"
]
}
@@ -1,11 +1,8 @@
language: node_js
services:
- postgresql
env:
- DATABASE_URL=postgres://localhost:5432/courtbot

node_js:
- "6"

before_script:
- psql -c 'create database courtbot;' -U postgres
- cp .env.sample .env
- npm run dbsetup
addons:
postgresql: "9.4"
- psql -c 'create database courtbook;' -U postgres
- node_modules/.bin/sequelize db:migrate
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/codeforanchorage/courtbot.svg?branch=master)](https://travis-ci.org/codeforanchorage/courtbot)
#Courtbot (Tulsa Edition) [![Build Status](https://travis-ci.org/codefortulsa/courtbot.svg?branch=master)](https://travis-ci.org/codefortulsa/courtbot)

## NOTES

@@ -4,7 +4,7 @@
"description": "Deliver simple court data via JSON or SMS.",
"main": "web.js",
"scripts": {
"test": "jasmine",
"test": "mocha",
"start": "node web.js",
"loaddata": "node runners/load.js"
},
@@ -17,7 +17,6 @@
"async": "~0.2.10",
"bluebird": "3.4.6",
"body-parser": "^1.15.2",
"chai": "^2.1.2",
"cookie-parser": "^1.4.3",
"cookie-session": "^2.0.0-alpha.2",
"courtbot-engine": "^1.1.0",
@@ -41,17 +40,25 @@
"request": "~2.34.0",
"sha1": "~1.1.0",
"timekeeper": "0.0.5",
"twilio": "~1.6.0",
"underscore": "~1.6.0"
"twilio": "~1.6.0"
},
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-loader": "^6.2.10",
"babel-preset-es2015": "^6.18.0",
"babel-register": "^6.18.0",
"chai": "^2.1.2",
"chai-as-promised": "^6.0.0",
"chance": "^1.0.4",
"cookie-parser": "^1.3.5",
"jasmine": "^2.5.2",
"dirty-chai": "^1.2.2",
"mocha": "^2.2.4",
"proxyquire": "^1.7.10",
"sinon": "^1.15.4",
"sinon-chai": "^2.8.0",
"supertest": "^0.15.0",
"supertest-session": "^0.0.7"
"supertest-session": "^0.0.7",
"webpack": "^1.14.0"
}
}
@@ -0,0 +1,6 @@
--require test/setup.js
--compilers js:babel-register
--recursive
--colors
--reporter nyan
--timeout 25000
@@ -0,0 +1,27 @@
import chai from "chai";
import chaiAsPromised from "chai-as-promised";
import dirtyChai from "dirty-chai";
import sinonChai from "sinon-chai";
import sinon from "sinon";
import Chance from "chance";

chai.use(sinonChai);
chai.use(chaiAsPromised);
chai.use(dirtyChai);

function setup() {
const sandbox = sinon.sandbox.create();

afterEach(function () {
sandbox.restore();
});

return {
expect: chai.expect,
should: chai.should(),
chance: new Chance(),
sandbox,
};
}

export default setup;

0 comments on commit 49bd3de

Please sign in to comment.
You can’t perform that action at this time.