diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..078314d --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/README.md b/README.md index 77e7f14..b2de3fe 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index 2a93bf7..0275fb0 100644 --- a/package.json +++ b/package.json @@ -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": [ diff --git a/test/main.test.js b/test/main.test.js index bb6f4d7..a5ddd0f 100644 --- a/test/main.test.js +++ b/test/main.test.js @@ -1,5 +1,5 @@ const { getFixtures } = require('../src') -const expect = require('chai').expect +const { expect, assert } = require('chai') describe('getFixtures', function () { before(function (done) { @@ -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.') }) })