diff --git a/README.md b/README.md index bac2f51..65637ce 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,55 @@ var options = { key: '' // <-- Pass in your nhl key here } }; + +var options_v3_stats = { + timeout: 15000, // Service call timeout + nba: { + version: 'v3/nba/stats', + key: '' // <-- Pass in your nba key here + }, + nfl: { + version: 'v3/nfl/stats', + key: '' // <-- Pass in your nfl key here + } +}; + +var options_v3_scores = { + timeout: 15000, // Service call timeout + nba: { + version: 'v3/nba/scores', + key: '' // <-- Pass in your nba key here + }, + nfl: { + version: 'v3/nfl/scores', + key: '' // <-- Pass in your nfl key here + } +}; + +var options_v3_projections = { + timeout: 15000, // Service call timeout + nba: { + version: 'v3/nba/projections', + key: '' // <-- Pass in your nba key here + }, + nfl: { + version: 'v3/nfl/projections', + key: '' // <-- Pass in your nfl key here + } +}; + +var options_v3_pbp = { + timeout: 15000, // Service call timeout + nba: { + version: 'v3/nba/pbp', + key: '' // <-- Pass in your nba key here + }, + nfl: { + version: 'v3/nfl/pbp', + key: '' // <-- Pass in your nfl key here + } +}; + ``` ## Example Usage @@ -53,6 +102,14 @@ var season = '2014REG'; fantasyData.nfl.Byes(season, function(err, results){ console.log(JSON.stringify(results, null, 2)); }); + +var fantasyDataV3Scores = require('fantasydata-api')(options_v3_scores); + +var season = '2014REG'; +fantasyDataV3Scores.nfl.Byes(season, function(err, results){ + console.log(JSON.stringify(results, null, 2)); +}); + ``` ## Parameters @@ -140,6 +197,7 @@ All methods are asynchronous and require the last parameter to be a callback fun * ```.playerGameStatsByPlayerId(season, week, playerId, callback)``` * ```.playerGameStatsByTeam(season, week, team, callback)``` * ```.playerGameStatsByWeek(season, week, callback)``` + * ```.playerSeasonStats(season, callback)``` * ```.playerSeasonStatsByPlayerId(season, playerId, callback)``` * ```.playerSeasonStatsByTeam(season, team, callback)``` * ```.recentlyUpdatedBoxScores(minutes, callback)``` @@ -174,6 +232,7 @@ All methods are asynchronous and require the last parameter to be a callback fun * ```.playerSeasonStats(season, callback)``` * ```.playerSeasonStatsByTeam(season, team, callback)``` * ```.playersByTeam(team, callback)``` + * ```.player(playerId, callback)``` * ```.playerGameProjectionStatsByDate(dateStr, callback)``` * ```.stadiums(callback)``` * ```.teamGameStatsByDate(dateStr, callback)``` @@ -244,4 +303,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/package.json b/package.json index 9b6b5bb..d7a509a 100644 --- a/package.json +++ b/package.json @@ -39,14 +39,14 @@ "author": "Nate Clark ", "license": "MIT", "dependencies": { - "async": "^1.4.2", + "async": "^1.5.2", "lodash": "^3.10.1", - "request": "^2.65.0" + "request": "^2.79.0" }, "devDependencies": { - "chai": "^3.4.0", + "chai": "^3.5.0", "codeclimate-test-reporter": "^0.1.1", - "istanbul": "^0.4.0", - "mocha": "^2.3.3" + "istanbul": "^0.4.5", + "mocha": "^2.5.3" } } diff --git a/server/fantasydata-api.js b/server/fantasydata-api.js index e648655..20febc7 100644 --- a/server/fantasydata-api.js +++ b/server/fantasydata-api.js @@ -170,7 +170,7 @@ module.exports = function(options) { makeRequest(uri, callback); } - + FantasyData.nhl.playerDetailsByPlayer = function (playerId, callback) { var uri = buildNhlUrl('Player/{{playerId}}', { playerId: playerId, @@ -251,7 +251,7 @@ module.exports = function(options) { makeRequest(uri, callback); } - + FantasyData.mlb.playerDetailsByPlayer = function (playerId, callback) { var uri = buildMlbUrl('Player/{{playerId}}', { playerId: playerId, @@ -265,14 +265,14 @@ module.exports = function(options) { makeRequest(uri, callback); } - + FantasyData.mlb.playerGameStatsByPlayer = function(gameDateStr, playerId, callback) { var uri = buildMlbUrl('PlayerGameStatsByPlayer/{{gameDateStr}}/{{playerId}}', {gameDateStr: gameDateStr, playerId: playerId}); makeRequest(uri, callback); } - - + + FantasyData.mlb.playerSeasonStats = function(season, callback) { var uri = buildMlbUrl('PlayerSeasonStats/{{season}}', {season: season}); @@ -297,7 +297,7 @@ module.exports = function(options) { makeRequest(uri, callback); } - + FantasyData.mlb.playerGameProjectionStatsByPlayer = function(gameDateStr, playerId, callback) { var uri = buildMlbUrl('PlayerGameProjectionStatsByPlayer/{{gameDateStr}}/{{playerId}}', {gameDateStr: gameDateStr, playerId: playerId}); @@ -420,6 +420,12 @@ module.exports = function(options) { makeRequest(uri, callback); } + FantasyData.nba.player = function(playerId, callback) { + var uri = buildNbaUrl('Player/{{playerId}}', {playerId: playerId}); + + makeRequest(uri, callback); + }; + FantasyData.nba.playerGameProjectionStatsByDate = function(gameDateStr, callback) { var uri = buildNbaUrl('PlayerGameProjectionStatsByDate/{{gameDateStr}}', {gameDateStr: gameDateStr}); @@ -632,6 +638,12 @@ module.exports = function(options) { makeRequest(uri, callback); }; + FantasyData.nfl.playerSeasonStats = function(season, callback) { + var uri = buildNflUrl('PlayerSeasonStats/{{season}}', {season: season}); + + makeRequest(uri, callback); + }; + FantasyData.nfl.playerSeasonStatsByPlayerId = function(season, playerId, callback) { var uri = buildNflUrl('PlayerSeasonStatsByPlayerId/{{season}}/{{playerId}}', {season: season, playerId: playerId}); diff --git a/test/config_v3_pbp.json b/test/config_v3_pbp.json new file mode 100644 index 0000000..39170c3 --- /dev/null +++ b/test/config_v3_pbp.json @@ -0,0 +1,12 @@ +{ + "debug": false, + "timeout": 15000, + "nfl": { + "key": "", + "version": "v3/nfl/pbp" + }, + "nba": { + "key": "", + "version": "v3/nba/pbp" + } +} diff --git a/test/config_v3_projections.json b/test/config_v3_projections.json new file mode 100644 index 0000000..c98341c --- /dev/null +++ b/test/config_v3_projections.json @@ -0,0 +1,12 @@ +{ + "debug": false, + "timeout": 15000, + "nfl": { + "key": "", + "version": "v3/nfl/projections" + }, + "nba": { + "key": "", + "version": "v3/nba/projections" + } +} diff --git a/test/config_v3_scores.json b/test/config_v3_scores.json new file mode 100644 index 0000000..5deaf75 --- /dev/null +++ b/test/config_v3_scores.json @@ -0,0 +1,12 @@ +{ + "debug": false, + "timeout": 15000, + "nfl": { + "key": "", + "version": "v3/nfl/scores" + }, + "nba": { + "key": "", + "version": "v3/nba/scores" + } +} diff --git a/test/config_v3_stats.json b/test/config_v3_stats.json new file mode 100644 index 0000000..d249a0f --- /dev/null +++ b/test/config_v3_stats.json @@ -0,0 +1,12 @@ +{ + "debug": false, + "timeout": 15000, + "nfl": { + "key": "", + "version": "v3/nfl/stats" + }, + "nba": { + "key": "", + "version": "v3/nba/stats" + } +} diff --git a/test/test.spec.js b/test/test.spec.js index a087994..261c0a9 100644 --- a/test/test.spec.js +++ b/test/test.spec.js @@ -1,12 +1,24 @@ var config = require('./config.json'); +var config_v3_stats = require('./config_v3_stats.json'); +var config_v3_scores = require('./config_v3_scores.json'); +var config_v3_projections = require('./config_v3_projections.json'); +var config_v3_pbp = require('./config_v3_pbp.json'); var expect = require('chai').expect; if(process.env.NFL_API_KEY) { config.nfl.key = process.env.NFL_API_KEY; + config_v3_stats.nfl.key = process.env.NFL_API_KEY; + config_v3_scores.nfl.key = process.env.NFL_API_KEY; + config_v3_projections.nfl.key = process.env.NFL_API_KEY; + config_v3_pbp.nfl.key = process.env.NFL_API_KEY; } if(process.env.NBA_API_KEY) { config.nba.key = process.env.NBA_API_KEY; + config_v3_stats.nba.key = process.env.NBA_API_KEY; + config_v3_scores.nba.key = process.env.NBA_API_KEY; + config_v3_projections.nba.key = process.env.NBA_API_KEY; + config_v3_pbp.nba.key = process.env.NBA_API_KEY; } if(process.env.MLB_API_KEY) { @@ -17,9 +29,17 @@ if(process.env.NHL_API_KEY) { config.nhl.key = process.env.NHL_API_KEY; } -config.timeout = 60 * 1000; +config.timeout = 300 * 1000; +config_v3_stats.timeout = 300 * 1000; +config_v3_scores.timeout = 300 * 1000; +config_v3_projections.timeout = 300 * 1000; +config_v3_pbp.timeout = 300 * 1000; var FantasyData = require('../server/fantasydata-api')(config); +var FantasyDataV3Stats = require('../server/fantasydata-api')(config_v3_stats); +var FantasyDataV3Scores = require('../server/fantasydata-api')(config_v3_scores); +var FantasyDataV3Projections = require('../server/fantasydata-api')(config_v3_projections); +var FantasyDataV3PlayByPlay = require('../server/fantasydata-api')(config_v3_pbp); describe('FantasyData', function() { describe('.nhl', function() { @@ -418,6 +438,7 @@ describe('FantasyData', function() { describe('.gamesBySeason()', function() { it('Results should return an array', function(done) { + this.timeout(0); FantasyData.mlb.gamesBySeason(season, function(err, results) { if(err) { return done(err); @@ -544,6 +565,7 @@ describe('FantasyData', function() { describe('.playByPlayDelta()', function() { it('Results should return an array', function(done) { + this.timeout(0); FantasyData.mlb.playByPlayDelta(gameDate, minutes, function(err, results) { if(err) { return done(err); @@ -604,7 +626,7 @@ describe('FantasyData', function() { var gameDate = '2015-MAY-15'; var minutes = 1; var season = 2015; - var playerId = 10000507; + var playerId = 20000485; var team = 'CLE'; describe('.activeTeams()', function() { @@ -620,261 +642,1186 @@ describe('FantasyData', function() { }); }); }); - - describe('.activePlayers()', function() { + + describe('.activePlayers()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.activePlayers(function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.boxScore()', function() { + it('Results should return an object', function(done) { + FantasyData.nba.boxScore(game, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('object'); + + return done(); + }); + }); + }); + + describe('.boxScores()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.boxScores(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.boxScoresDelta()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.boxScoresDelta(gameDate, minutes, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.freeAgents()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.freeAgents(function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.gamesByDate()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.gamesByDate(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.gamesBySeason()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.gamesBySeason(season, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.news()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.news(function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.newsByDate()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.newsByDate(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.newsByPlayerId()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.newsByPlayerId(playerId, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.playerGameStatsByDate()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.playerGameStatsByDate(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.playerSeasonStats()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.playerSeasonStats(season, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.playerSeasonStatsByTeam()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.playerSeasonStatsByTeam(season, team, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.playersByTeam()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.playersByTeam(team, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.player()', function() { + it('Results should return an object', function(done) { + FantasyData.nba.player(playerId, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('object'); + + return done(); + }); + }); + }); + + describe('.playerGameProjectionStatsByDate()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.playerGameProjectionStatsByDate(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.stadiums()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.stadiums(function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.teamGameStatsByDate()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.teamGameStatsByDate(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.teamSeasonStats()', function() { + it('Results should return an array', function(done) { + FantasyData.nba.teamSeasonStats(season, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + }); + + describe('.nba_v3', function() { + var game = 56; + var gameDate = '2015-MAY-15'; + var minutes = 1; + var season = 2015; + var playerId = 20000485; + var team = 'CLE'; + + describe('.activeTeams()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.activeTeams(function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.activePlayers()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.activePlayers(function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.boxScore()', function() { + it('Results should return an object', function(done) { + FantasyDataV3Stats.nba.boxScore(game, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('object'); + + return done(); + }); + }); + }); + + describe('.boxScores()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.boxScores(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.boxScoresDelta()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.boxScoresDelta(gameDate, minutes, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.freeAgents()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.freeAgents(function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.gamesByDate()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.gamesByDate(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.gamesBySeason()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.gamesBySeason(season, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.news()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.news(function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.newsByDate()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.newsByDate(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.newsByPlayerId()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.newsByPlayerId(playerId, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.playerGameStatsByDate()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.playerGameStatsByDate(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.playerSeasonStats()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.playerSeasonStats(season, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.playerSeasonStatsByTeam()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.playerSeasonStatsByTeam(season, team, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.playersByTeam()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.playersByTeam(team, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.player()', function() { + it('Results should return an object', function(done) { + FantasyDataV3Stats.nba.player(playerId, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('object'); + + return done(); + }); + }); + }); + + describe('.playerGameProjectionStatsByDate()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Projections.nba.playerGameProjectionStatsByDate(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.stadiums()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.stadiums(function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.teamGameStatsByDate()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.teamGameStatsByDate(gameDate, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + + describe('.teamSeasonStats()', function() { + it('Results should return an array', function(done) { + FantasyDataV3Stats.nba.teamSeasonStats(season, function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + }); + + describe('.nfl', function() { + var season = process.env.SEASON || 2013; + var week = 1; + var team = 'IND'; + var minutes = 1; + var statsColumn = 'PassingYards'; + var timeFrameType = 'current'; + + var player = { + id: 14008, + position: 'QB' + }; + + var homeTeam = team; + + var searchCriteria = { + team: team, + firstName: 'Andrew', + lastName: 'Luck', + fullName: null, + number: null, + dob: null, + position: 'QB', + college: null + }; + + describe('.activeBoxScores()', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.activeBoxScores(function(err, results) { + if(err) { + return done(err); + } + + expect(results).to.be.an('array'); + + return done(); + }); + }); + }); + describe('.areAnyGamesInProgress()', function() { + it('Results should return a boolean', function(done) { + FantasyData.nfl.areAnyGamesInProgress(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.a('boolean'); + done(); + }); + }); + }); + describe('.boxScore(season, week, homeTeam)', function() { + it('Results should return an object', function(done) { + FantasyData.nfl.boxScore(season, week, homeTeam, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('object'); + done(); + }); + }); + }); + describe('.boxScores(season, week)', function() { + it('Results should return an array', function(done) { + this.timeout(0); + FantasyData.nfl.boxScores(season, week, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.byes(season)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.byes(season, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.currentSeason()', function() { + it('Results should return a number', function(done) { + FantasyData.nfl.currentSeason(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.a('number'); + done(); + }); + }); + }); + describe('.currentWeek()', function() { + it('Results should return a number', function(done) { + FantasyData.nfl.currentWeek(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.a('number'); + done(); + }); + }); + }); + describe('.fantasyDefenseByGame(season, week)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.fantasyDefenseByGame(season, week, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.fantasyDefenseBySeason(season)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.fantasyDefenseBySeason(season, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.fantasyDefenseProjectionsByGame(season, week)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.fantasyDefenseProjectionsByGame(season, week, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.fantasyPlayers()', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.fantasyPlayers(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.finalBoxScores()', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.finalBoxScores(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.freeAgents()', function() { + it('Results should return an array', function(done) { + this.timeout(0); + FantasyData.nfl.freeAgents(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.gameLeagueLeaders(season, week, position, statsColumn)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.gameLeagueLeaders(season, week, player.position, statsColumn, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.gameStats(season)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.gameStats(season, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.gameStatsByWeek(season, week)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.gameStatsByWeek(season, week, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.getErrorSample()', function() { + it.skip('Results should return an object', function(done) { + FantasyData.nfl.getErrorSample(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('object'); + done(); + }); + }); + }); + describe('.injuriesByTeam(season, week, team)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.injuriesByTeam(season, week, team, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.injuriesByWeek(season, week)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.injuriesByWeek(season, week, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.lastCompletedSeason()', function() { + it('Results should return a number', function(done) { + FantasyData.nfl.lastCompletedSeason(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.a('number'); + done(); + }); + }); + }); + describe('.lastCompletedWeek()', function() { + it('Results should return a number', function(done) { + FantasyData.nfl.lastCompletedWeek(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.a('number'); + done(); + }); + }); + }); + describe('.liveBoxScores()', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.liveBoxScores(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.matchPlayer(searchCriteria)', function() { + it('Results should return an object', function(done) { + FantasyData.nfl.matchPlayer(searchCriteria, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('object'); + done(); + }); + }); + }); + describe('.news()', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.news(function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.newsByPlayerId(playerId)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.newsByPlayerId(player.id, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.newsByTeam(team)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.newsByTeam(team, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.player(playerId)', function() { + it('Results should return an object', function(done) { + FantasyData.nfl.player(player.id, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('object'); + done(); + }); + }); + }); + describe('.playerGameProjectionStatsByTeam(season, week, team)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.playerGameProjectionStatsByTeam(season, week, team, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.playerGameStatsByPlayerId(season, week, playerId)', function() { + it('Results should return an object', function(done) { + FantasyData.nfl.playerGameStatsByPlayerId(season, week, player.id, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('object'); + done(); + }); + }); + }); + describe('.playerGameStatsByTeam(season, week, team)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.playerGameStatsByTeam(season, week, team, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.playerGameStatsByWeek(season, week)', function() { + it('Results should return an array', function(done) { + this.timeout(0); + FantasyData.nfl.playerGameStatsByWeek(season, week, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.playerSeasonStats(season, playerId)', function() { it('Results should return an array', function(done) { - FantasyData.nba.activePlayers(function(err, results) { + this.timeout(0); + FantasyData.nfl.playerSeasonStats(season, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.boxScore()', function() { - it('Results should return an object', function(done) { - FantasyData.nba.boxScore(game, function(err, results) { + describe('.playerSeasonStatsByPlayerId(season, playerId)', function() { + it('Results should return an array', function(done) { + FantasyData.nfl.playerSeasonStatsByPlayerId(season, player.id, function(err, results) { if(err) { - return done(err); + done(err); } - expect(results).to.be.an('object'); - - return done(); + expect(results).to.be.an('array'); + done(); }); }); }); - - describe('.boxScores()', function() { + describe('.playerSeasonStatsByTeam(season, team)', function() { it('Results should return an array', function(done) { - FantasyData.nba.boxScores(gameDate, function(err, results) { + FantasyData.nfl.playerSeasonStatsByTeam(season, team, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.boxScoresDelta()', function() { + describe('.recentlyUpdatedBoxScores(minutes)', function() { it('Results should return an array', function(done) { - FantasyData.nba.boxScoresDelta(gameDate, minutes, function(err, results) { + FantasyData.nfl.recentlyUpdatedBoxScores(minutes, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.freeAgents()', function() { + describe('.schedules(season)', function() { it('Results should return an array', function(done) { - FantasyData.nba.freeAgents(function(err, results) { + FantasyData.nfl.schedules(season, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.gamesByDate()', function() { + describe('.scores(season)', function() { it('Results should return an array', function(done) { - FantasyData.nba.gamesByDate(gameDate, function(err, results) { + FantasyData.nfl.scores(season, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.gamesBySeason()', function() { + describe('.scoresByWeek(season, week)', function() { it('Results should return an array', function(done) { - FantasyData.nba.gamesBySeason(season, function(err, results) { + FantasyData.nfl.scoresByWeek(season, week, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.news()', function() { + describe('.seasonLeagueLeaders(season, position, statsColumn)', function() { it('Results should return an array', function(done) { - FantasyData.nba.news(function(err, results) { + FantasyData.nfl.seasonLeagueLeaders(season, player.position, statsColumn, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.newsByDate()', function() { + describe('.stadiums()', function() { it('Results should return an array', function(done) { - FantasyData.nba.newsByDate(gameDate, function(err, results) { + FantasyData.nfl.stadiums(function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.newsByPlayerId()', function() { + describe('.standings(season)', function() { it('Results should return an array', function(done) { - FantasyData.nba.newsByPlayerId(playerId, function(err, results) { + FantasyData.nfl.standings(season, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.playerGameStatsByDate()', function() { + describe('.teamGameStats(season, week)', function() { it('Results should return an array', function(done) { - FantasyData.nba.playerGameStatsByDate(gameDate, function(err, results) { + FantasyData.nfl.teamGameStats(season, week, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.playerSeasonStats()', function() { + describe('.teamRoster(team)', function() { it('Results should return an array', function(done) { - FantasyData.nba.playerSeasonStats(season, function(err, results) { + this.timeout(0); + FantasyData.nfl.teamRoster(team, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.playerSeasonStatsByTeam()', function() { + describe('.teamSeasonStats(season)', function() { it('Results should return an array', function(done) { - FantasyData.nba.playerSeasonStatsByTeam(season, team, function(err, results) { + FantasyData.nfl.teamSeasonStats(season, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.playersByTeam()', function() { + describe('.teams()', function() { it('Results should return an array', function(done) { - FantasyData.nba.playersByTeam(team, function(err, results) { + FantasyData.nfl.teams(function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.playerGameProjectionStatsByDate()', function() { + describe('.teamsBySeason(season)', function() { it('Results should return an array', function(done) { - FantasyData.nba.playerGameProjectionStatsByDate(gameDate, function(err, results) { + FantasyData.nfl.teamsBySeason(season, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.stadiums()', function() { + describe('.timeFrames(timeFrameType)', function() { it('Results should return an array', function(done) { - FantasyData.nba.stadiums(function(err, results) { + FantasyData.nfl.timeFrames(timeFrameType, function(err, results) { if(err) { - return done(err); + done(err); } expect(results).to.be.an('array'); - - return done(); + done(); }); }); }); - - describe('.teamGameStatsByDate()', function() { - it('Results should return an array', function(done) { - FantasyData.nba.teamGameStatsByDate(gameDate, function(err, results) { + describe('.upcomingSeason()', function() { + it('Results should return a number', function(done) { + FantasyData.nfl.upcomingSeason(function(err, results) { if(err) { - return done(err); + done(err); } - expect(results).to.be.an('array'); - - return done(); + expect(results).to.be.an('number'); + done(); }); }); }); - - describe('.teamSeasonStats()', function() { - it('Results should return an array', function(done) { - FantasyData.nba.teamSeasonStats(season, function(err, results) { + describe('.upcomingWeek()', function() { + it('Results should return a number', function(done) { + FantasyData.nfl.upcomingWeek(function(err, results) { if(err) { - return done(err); + done(err); } - expect(results).to.be.an('array'); - - return done(); + expect(results).to.be.an('number'); + done(); }); }); }); }); - describe('.nfl', function() { + describe('.nfl_v3', function() { var season = process.env.SEASON || 2013; var week = 1; var team = 'IND'; @@ -902,7 +1849,7 @@ describe('FantasyData', function() { describe('.activeBoxScores()', function() { it('Results should return an array', function(done) { - FantasyData.nfl.activeBoxScores(function(err, results) { + FantasyDataV3Stats.nfl.activeBoxScores(function(err, results) { if(err) { return done(err); } @@ -915,7 +1862,7 @@ describe('FantasyData', function() { }); describe('.areAnyGamesInProgress()', function() { it('Results should return a boolean', function(done) { - FantasyData.nfl.areAnyGamesInProgress(function(err, results) { + FantasyDataV3Scores.nfl.areAnyGamesInProgress(function(err, results) { if(err) { done(err); } @@ -927,7 +1874,7 @@ describe('FantasyData', function() { }); describe('.boxScore(season, week, homeTeam)', function() { it('Results should return an object', function(done) { - FantasyData.nfl.boxScore(season, week, homeTeam, function(err, results) { + FantasyDataV3Stats.nfl.boxScore(season, week, homeTeam, function(err, results) { if(err) { done(err); } @@ -940,7 +1887,7 @@ describe('FantasyData', function() { describe('.boxScores(season, week)', function() { it('Results should return an array', function(done) { this.timeout(0); - FantasyData.nfl.boxScores(season, week, function(err, results) { + FantasyDataV3Stats.nfl.boxScores(season, week, function(err, results) { if(err) { done(err); } @@ -952,7 +1899,7 @@ describe('FantasyData', function() { }); describe('.byes(season)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.byes(season, function(err, results) { + FantasyDataV3Scores.nfl.byes(season, function(err, results) { if(err) { done(err); } @@ -964,7 +1911,7 @@ describe('FantasyData', function() { }); describe('.currentSeason()', function() { it('Results should return a number', function(done) { - FantasyData.nfl.currentSeason(function(err, results) { + FantasyDataV3Scores.nfl.currentSeason(function(err, results) { if(err) { done(err); } @@ -976,7 +1923,7 @@ describe('FantasyData', function() { }); describe('.currentWeek()', function() { it('Results should return a number', function(done) { - FantasyData.nfl.currentWeek(function(err, results) { + FantasyDataV3Scores.nfl.currentWeek(function(err, results) { if(err) { done(err); } @@ -988,7 +1935,7 @@ describe('FantasyData', function() { }); describe('.fantasyDefenseByGame(season, week)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.fantasyDefenseByGame(season, week, function(err, results) { + FantasyDataV3Stats.nfl.fantasyDefenseByGame(season, week, function(err, results) { if(err) { done(err); } @@ -1000,7 +1947,7 @@ describe('FantasyData', function() { }); describe('.fantasyDefenseBySeason(season)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.fantasyDefenseBySeason(season, function(err, results) { + FantasyDataV3Stats.nfl.fantasyDefenseBySeason(season, function(err, results) { if(err) { done(err); } @@ -1012,7 +1959,7 @@ describe('FantasyData', function() { }); describe('.fantasyDefenseProjectionsByGame(season, week)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.fantasyDefenseProjectionsByGame(season, week, function(err, results) { + FantasyDataV3Projections.nfl.fantasyDefenseProjectionsByGame(season, week, function(err, results) { if(err) { done(err); } @@ -1024,7 +1971,7 @@ describe('FantasyData', function() { }); describe('.fantasyPlayers()', function() { it('Results should return an array', function(done) { - FantasyData.nfl.fantasyPlayers(function(err, results) { + FantasyDataV3Stats.nfl.fantasyPlayers(function(err, results) { if(err) { done(err); } @@ -1036,7 +1983,7 @@ describe('FantasyData', function() { }); describe('.finalBoxScores()', function() { it('Results should return an array', function(done) { - FantasyData.nfl.finalBoxScores(function(err, results) { + FantasyDataV3Stats.nfl.finalBoxScores(function(err, results) { if(err) { done(err); } @@ -1049,7 +1996,7 @@ describe('FantasyData', function() { describe('.freeAgents()', function() { it('Results should return an array', function(done) { this.timeout(0); - FantasyData.nfl.freeAgents(function(err, results) { + FantasyDataV3Stats.nfl.freeAgents(function(err, results) { if(err) { done(err); } @@ -1061,7 +2008,7 @@ describe('FantasyData', function() { }); describe('.gameLeagueLeaders(season, week, position, statsColumn)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.gameLeagueLeaders(season, week, player.position, statsColumn, function(err, results) { + FantasyDataV3Stats.nfl.gameLeagueLeaders(season, week, player.position, statsColumn, function(err, results) { if(err) { done(err); } @@ -1073,7 +2020,7 @@ describe('FantasyData', function() { }); describe('.gameStats(season)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.gameStats(season, function(err, results) { + FantasyDataV3Stats.nfl.gameStats(season, function(err, results) { if(err) { done(err); } @@ -1085,7 +2032,7 @@ describe('FantasyData', function() { }); describe('.gameStatsByWeek(season, week)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.gameStatsByWeek(season, week, function(err, results) { + FantasyDataV3Stats.nfl.gameStatsByWeek(season, week, function(err, results) { if(err) { done(err); } @@ -1097,7 +2044,7 @@ describe('FantasyData', function() { }); describe('.getErrorSample()', function() { it.skip('Results should return an object', function(done) { - FantasyData.nfl.getErrorSample(function(err, results) { + FantasyDataV3Stats.nfl.getErrorSample(function(err, results) { if(err) { done(err); } @@ -1109,7 +2056,7 @@ describe('FantasyData', function() { }); describe('.injuriesByTeam(season, week, team)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.injuriesByTeam(season, week, team, function(err, results) { + FantasyDataV3Stats.nfl.injuriesByTeam(season, week, team, function(err, results) { if(err) { done(err); } @@ -1121,7 +2068,7 @@ describe('FantasyData', function() { }); describe('.injuriesByWeek(season, week)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.injuriesByWeek(season, week, function(err, results) { + FantasyDataV3Stats.nfl.injuriesByWeek(season, week, function(err, results) { if(err) { done(err); } @@ -1133,7 +2080,7 @@ describe('FantasyData', function() { }); describe('.lastCompletedSeason()', function() { it('Results should return a number', function(done) { - FantasyData.nfl.lastCompletedSeason(function(err, results) { + FantasyDataV3Scores.nfl.lastCompletedSeason(function(err, results) { if(err) { done(err); } @@ -1145,7 +2092,7 @@ describe('FantasyData', function() { }); describe('.lastCompletedWeek()', function() { it('Results should return a number', function(done) { - FantasyData.nfl.lastCompletedWeek(function(err, results) { + FantasyDataV3Scores.nfl.lastCompletedWeek(function(err, results) { if(err) { done(err); } @@ -1157,7 +2104,7 @@ describe('FantasyData', function() { }); describe('.liveBoxScores()', function() { it('Results should return an array', function(done) { - FantasyData.nfl.liveBoxScores(function(err, results) { + FantasyDataV3Stats.nfl.liveBoxScores(function(err, results) { if(err) { done(err); } @@ -1169,7 +2116,7 @@ describe('FantasyData', function() { }); describe('.matchPlayer(searchCriteria)', function() { it('Results should return an object', function(done) { - FantasyData.nfl.matchPlayer(searchCriteria, function(err, results) { + FantasyDataV3Stats.nfl.matchPlayer(searchCriteria, function(err, results) { if(err) { done(err); } @@ -1181,7 +2128,7 @@ describe('FantasyData', function() { }); describe('.news()', function() { it('Results should return an array', function(done) { - FantasyData.nfl.news(function(err, results) { + FantasyDataV3Scores.nfl.news(function(err, results) { if(err) { done(err); } @@ -1193,7 +2140,7 @@ describe('FantasyData', function() { }); describe('.newsByPlayerId(playerId)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.newsByPlayerId(player.id, function(err, results) { + FantasyDataV3Scores.nfl.newsByPlayerId(player.id, function(err, results) { if(err) { done(err); } @@ -1205,7 +2152,7 @@ describe('FantasyData', function() { }); describe('.newsByTeam(team)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.newsByTeam(team, function(err, results) { + FantasyDataV3Scores.nfl.newsByTeam(team, function(err, results) { if(err) { done(err); } @@ -1217,7 +2164,7 @@ describe('FantasyData', function() { }); describe('.player(playerId)', function() { it('Results should return an object', function(done) { - FantasyData.nfl.player(player.id, function(err, results) { + FantasyDataV3Stats.nfl.player(player.id, function(err, results) { if(err) { done(err); } @@ -1229,7 +2176,7 @@ describe('FantasyData', function() { }); describe('.playerGameProjectionStatsByTeam(season, week, team)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.playerGameProjectionStatsByTeam(season, week, team, function(err, results) { + FantasyDataV3Projections.nfl.playerGameProjectionStatsByTeam(season, week, team, function(err, results) { if(err) { done(err); } @@ -1241,7 +2188,7 @@ describe('FantasyData', function() { }); describe('.playerGameStatsByPlayerId(season, week, playerId)', function() { it('Results should return an object', function(done) { - FantasyData.nfl.playerGameStatsByPlayerId(season, week, player.id, function(err, results) { + FantasyDataV3Stats.nfl.playerGameStatsByPlayerId(season, week, player.id, function(err, results) { if(err) { done(err); } @@ -1253,7 +2200,7 @@ describe('FantasyData', function() { }); describe('.playerGameStatsByTeam(season, week, team)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.playerGameStatsByTeam(season, week, team, function(err, results) { + FantasyDataV3Stats.nfl.playerGameStatsByTeam(season, week, team, function(err, results) { if(err) { done(err); } @@ -1266,7 +2213,20 @@ describe('FantasyData', function() { describe('.playerGameStatsByWeek(season, week)', function() { it('Results should return an array', function(done) { this.timeout(0); - FantasyData.nfl.playerGameStatsByWeek(season, week, function(err, results) { + FantasyDataV3Stats.nfl.playerGameStatsByWeek(season, week, function(err, results) { + if(err) { + done(err); + } + + expect(results).to.be.an('array'); + done(); + }); + }); + }); + describe('.playerSeasonStats(season, playerId)', function() { + it('Results should return an array', function(done) { + this.timeout(0); + FantasyDataV3Stats.nfl.playerSeasonStats(season, function(err, results) { if(err) { done(err); } @@ -1278,7 +2238,7 @@ describe('FantasyData', function() { }); describe('.playerSeasonStatsByPlayerId(season, playerId)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.playerSeasonStatsByPlayerId(season, player.id, function(err, results) { + FantasyDataV3Stats.nfl.playerSeasonStatsByPlayerId(season, player.id, function(err, results) { if(err) { done(err); } @@ -1290,7 +2250,7 @@ describe('FantasyData', function() { }); describe('.playerSeasonStatsByTeam(season, team)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.playerSeasonStatsByTeam(season, team, function(err, results) { + FantasyDataV3Stats.nfl.playerSeasonStatsByTeam(season, team, function(err, results) { if(err) { done(err); } @@ -1302,7 +2262,7 @@ describe('FantasyData', function() { }); describe('.recentlyUpdatedBoxScores(minutes)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.recentlyUpdatedBoxScores(minutes, function(err, results) { + FantasyDataV3Stats.nfl.recentlyUpdatedBoxScores(minutes, function(err, results) { if(err) { done(err); } @@ -1314,7 +2274,7 @@ describe('FantasyData', function() { }); describe('.schedules(season)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.schedules(season, function(err, results) { + FantasyDataV3Scores.nfl.schedules(season, function(err, results) { if(err) { done(err); } @@ -1326,7 +2286,7 @@ describe('FantasyData', function() { }); describe('.scores(season)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.scores(season, function(err, results) { + FantasyDataV3Scores.nfl.scores(season, function(err, results) { if(err) { done(err); } @@ -1338,7 +2298,7 @@ describe('FantasyData', function() { }); describe('.scoresByWeek(season, week)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.scoresByWeek(season, week, function(err, results) { + FantasyDataV3Scores.nfl.scoresByWeek(season, week, function(err, results) { if(err) { done(err); } @@ -1350,7 +2310,7 @@ describe('FantasyData', function() { }); describe('.seasonLeagueLeaders(season, position, statsColumn)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.seasonLeagueLeaders(season, player.position, statsColumn, function(err, results) { + FantasyDataV3Stats.nfl.seasonLeagueLeaders(season, player.position, statsColumn, function(err, results) { if(err) { done(err); } @@ -1362,7 +2322,7 @@ describe('FantasyData', function() { }); describe('.stadiums()', function() { it('Results should return an array', function(done) { - FantasyData.nfl.stadiums(function(err, results) { + FantasyDataV3Scores.nfl.stadiums(function(err, results) { if(err) { done(err); } @@ -1374,7 +2334,7 @@ describe('FantasyData', function() { }); describe('.standings(season)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.standings(season, function(err, results) { + FantasyDataV3Scores.nfl.standings(season, function(err, results) { if(err) { done(err); } @@ -1386,7 +2346,7 @@ describe('FantasyData', function() { }); describe('.teamGameStats(season, week)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.teamGameStats(season, week, function(err, results) { + FantasyDataV3Stats.nfl.teamGameStats(season, week, function(err, results) { if(err) { done(err); } @@ -1398,7 +2358,8 @@ describe('FantasyData', function() { }); describe('.teamRoster(team)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.teamRoster(team, function(err, results) { + this.timeout(0); + FantasyDataV3Stats.nfl.teamRoster(team, function(err, results) { if(err) { done(err); } @@ -1410,7 +2371,7 @@ describe('FantasyData', function() { }); describe('.teamSeasonStats(season)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.teamSeasonStats(season, function(err, results) { + FantasyDataV3Stats.nfl.teamSeasonStats(season, function(err, results) { if(err) { done(err); } @@ -1422,7 +2383,7 @@ describe('FantasyData', function() { }); describe('.teams()', function() { it('Results should return an array', function(done) { - FantasyData.nfl.teams(function(err, results) { + FantasyDataV3Scores.nfl.teams(function(err, results) { if(err) { done(err); } @@ -1434,7 +2395,7 @@ describe('FantasyData', function() { }); describe('.teamsBySeason(season)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.teamsBySeason(season, function(err, results) { + FantasyDataV3Scores.nfl.teamsBySeason(season, function(err, results) { if(err) { done(err); } @@ -1446,7 +2407,7 @@ describe('FantasyData', function() { }); describe('.timeFrames(timeFrameType)', function() { it('Results should return an array', function(done) { - FantasyData.nfl.timeFrames(timeFrameType, function(err, results) { + FantasyDataV3Scores.nfl.timeFrames(timeFrameType, function(err, results) { if(err) { done(err); } @@ -1458,7 +2419,7 @@ describe('FantasyData', function() { }); describe('.upcomingSeason()', function() { it('Results should return a number', function(done) { - FantasyData.nfl.upcomingSeason(function(err, results) { + FantasyDataV3Scores.nfl.upcomingSeason(function(err, results) { if(err) { done(err); } @@ -1470,7 +2431,7 @@ describe('FantasyData', function() { }); describe('.upcomingWeek()', function() { it('Results should return a number', function(done) { - FantasyData.nfl.upcomingWeek(function(err, results) { + FantasyDataV3Scores.nfl.upcomingWeek(function(err, results) { if(err) { done(err); } @@ -1481,4 +2442,5 @@ describe('FantasyData', function() { }); }); }); + });