Skip to content

Commit

Permalink
Configure travis for testing (#6)
Browse files Browse the repository at this point in the history
* feat: add fail handling for test

* feat: create .travis.yml

* feat: update readme and package.json

* chore: update .travis.yml

* chore: force exit of mocha when finished
  • Loading branch information
o8e authored Mar 16, 2018
1 parent 7b01d6e commit 6555e39
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
os:
- linux
language: node_js
node_js:
- '8.9.4'
cache:
directories:
- 'node_modules'
install:
- npm install -g babel-cli
- npm install
sudo: required
addons:
chrome: stable
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ npm run dev

* 0.0.2
* Update docs and publish to NPM (module code remains unchanged)
* Add testing with mocha/chai and configure travis
* 0.0.1
* Develop initial function to fetch fixtures

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "soccer-scrape",
"version": "0.0.1",
"version": "0.0.2",
"description": "Scrape football data from Bet365",
"main": "src/index.js",
"scripts": {
"dev": "backpack",
"test": "mocha --require babel-core/register --require babel-polyfill --no-timeouts"
"test": "mocha --require babel-core/register --require babel-polyfill --no-timeouts --exit"
},
"babel": {
"presets": [
Expand Down
4 changes: 3 additions & 1 deletion test/main.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { getFixtures } = require('../src')
const expect = require('chai').expect
const { expect, assert } = require('chai')

describe('getFixtures', function () {
before(function (done) {
Expand All @@ -8,6 +8,8 @@ describe('getFixtures', function () {
getFixtures().then(res => {
this.data = res
done()
}).catch(err => {
assert.fail(0, 1, 'Failed to fetch fixtures. URL could be broken or website is down.')
})
})

Expand Down

0 comments on commit 6555e39

Please sign in to comment.