-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conforming to current jasmine api. Passing needed test values #42
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"An API to help facilitate the use of the Yahoo! Fantasy Sports API in NodeJS projects.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node -r @std/esm jasmine-runner.js", | ||
"test": "node -r esm jasmine-runner.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scoped package |
||
"istanbul": "istanbul cover --include-all-sources jasmine-node tests" | ||
}, | ||
"repository": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,7 @@ describe("resource : gameResource", function() { | |
// leagues | ||
describe(": leagues", function() { | ||
it("should build a proper url to retrieve league data for a single league using a numeric game key", function() { | ||
game.leagues(328, "328.l.34014", null); | ||
game.leagues(328, "328.l.34014", () => {}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just need to provide some callback, even though we aren't testing the value called-back-with. |
||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -83,7 +83,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve league data for a single league using a string game key", function() { | ||
game.leagues("mlb", "mlb.l.34014", null); | ||
game.leagues("mlb", "mlb.l.34014", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -93,7 +93,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve league data for a single league using a numeric game key and league as an array", function() { | ||
game.leagues(328, ["328.l.34014"], null); | ||
game.leagues(328, ["328.l.34014"], () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -103,7 +103,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve league data for a single league using a string game key and league as an array", function() { | ||
game.leagues("mlb", ["mlb.l.34014"], null); | ||
game.leagues("mlb", ["mlb.l.34014"], () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -113,7 +113,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve league data for a multiple leagues using a numeric game key", function() { | ||
game.leagues(328, ["328.l.34014", "328.l.24281"], null); | ||
game.leagues(328, ["328.l.34014", "328.l.24281"], () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -123,7 +123,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve league data for a multiple leagues using a string game key", function() { | ||
game.leagues("mlb", ["mlb.l.34014", "mlb.l.24281"], null); | ||
game.leagues("mlb", ["mlb.l.34014", "mlb.l.24281"], () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -135,7 +135,7 @@ describe("resource : gameResource", function() { | |
|
||
// players | ||
it("should build a proper url to retrieve player data for a single player using a numeric game key", function() { | ||
game.players(328, "328.p.6619", null); | ||
game.players(328, "328.p.6619", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -145,7 +145,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve player data for a single player using a string game key", function() { | ||
game.players("mlb", "mlb.p.6619", null); | ||
game.players("mlb", "mlb.p.6619", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -155,7 +155,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve player data for a single player using a numeric game key and player as an array", function() { | ||
game.players(328, ["328.p.6619"], null); | ||
game.players(328, ["328.p.6619"], () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -165,7 +165,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve player data for a single player using a string game key and player as an array", function() { | ||
game.players("mlb", ["mlb.p.6619"], null); | ||
game.players("mlb", ["mlb.p.6619"], () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -175,7 +175,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve player data for a multiple players using a numeric game key", function() { | ||
game.players(328, ["328.p.6619", "328.p.8172"], null); | ||
game.players(328, ["328.p.6619", "328.p.8172"], () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -185,7 +185,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve player data for a multiple players using a string game key", function() { | ||
game.players("mlb", ["mlb.p.6619", "mlb.p.8172"], null); | ||
game.players("mlb", ["mlb.p.6619", "mlb.p.8172"], () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -196,7 +196,7 @@ describe("resource : gameResource", function() { | |
|
||
// game_weeks | ||
it("should build a proper url to retrieve game weeks using a numeric game key", function() { | ||
game.game_weeks(328, null); | ||
game.game_weeks(328, () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -206,7 +206,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve game weeks using a string game key", function() { | ||
game.game_weeks("nfl", null); | ||
game.game_weeks("nfl", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -217,7 +217,7 @@ describe("resource : gameResource", function() { | |
|
||
// stat_categories | ||
it("should build a proper url to retrieve stat categories using a numeric game key", function() { | ||
game.stat_categories(328, null); | ||
game.stat_categories(328, () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -227,7 +227,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve stat categories using a string game key", function() { | ||
game.stat_categories("nfl", null); | ||
game.stat_categories("nfl", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -238,7 +238,7 @@ describe("resource : gameResource", function() { | |
|
||
// position_types | ||
it("should build a proper url to retrieve position types using a numeric game key", function() { | ||
game.position_types(328, null); | ||
game.position_types(328, () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -248,7 +248,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve position types using a string game key", function() { | ||
game.position_types("nfl", null); | ||
game.position_types("nfl", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -259,7 +259,7 @@ describe("resource : gameResource", function() { | |
|
||
// roster_positions | ||
it("should build a proper url to retrieve roster positions using a numeric game key", function() { | ||
game.roster_positions(328, null); | ||
game.roster_positions(328, () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -269,7 +269,7 @@ describe("resource : gameResource", function() { | |
}); | ||
|
||
it("should build a proper url to retrieve roster positions using a string game key", function() { | ||
game.roster_positions("nfl", null); | ||
game.roster_positions("nfl", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,9 +51,9 @@ describe("resource: leagueResource", function() { | |
it("should build a proper url to retrieve metadata via a league key", function() { | ||
nock("https://fantasysports.yahooapis.com") | ||
.get("/fantasy/v2/league/328.l.34014/metadata?format=json") | ||
.reply(200, {}); | ||
.reply(200, require("./nock-data/leagueMeta").meta); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to return some data, because the object mapping classes expect there to be at least a fantasy_content field. |
||
|
||
league.meta("328.l.34014", null); | ||
league.meta("328.l.34014", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -66,9 +66,9 @@ describe("resource: leagueResource", function() { | |
it("should build a proper url to retrieve settings via a league key", function() { | ||
nock("https://fantasysports.yahooapis.com") | ||
.get("/fantasy/v2/league/328.l.34014/settings?format=json") | ||
.reply(200, {}); | ||
.reply(200, require("./nock-data/leagueSettings")); | ||
|
||
league.settings("328.l.34014", null); | ||
league.settings("328.l.34014", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -81,9 +81,9 @@ describe("resource: leagueResource", function() { | |
it("should build a proper url to retrieve standings via a league key", function() { | ||
nock("https://fantasysports.yahooapis.com") | ||
.get("/fantasy/v2/league/328.l.34014/standings?format=json") | ||
.reply(200, {}); | ||
.reply(200, require("./nock-data/leagueStandings")); | ||
|
||
league.standings("328.l.34014", null); | ||
league.standings("328.l.34014", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -96,9 +96,9 @@ describe("resource: leagueResource", function() { | |
it("should build a proper url to retrieve scoreboard via a league key", function() { | ||
nock("https://fantasysports.yahooapis.com") | ||
.get("/fantasy/v2/league/328.l.34014/scoreboard?format=json") | ||
.reply(200, {}); | ||
.reply(200, require("./nock-data/leagueScoreboard")); | ||
|
||
league.scoreboard("328.l.34014", null); | ||
league.scoreboard("328.l.34014", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -111,9 +111,9 @@ describe("resource: leagueResource", function() { | |
it("should build a proper url to retrieve teams via a league key", function() { | ||
nock("https://fantasysports.yahooapis.com") | ||
.get("/fantasy/v2/league/328.l.34014/teams?format=json") | ||
.reply(200, {}); | ||
.reply(200, require("./nock-data/leagueTeams")); | ||
|
||
league.teams("328.l.34014", null); | ||
league.teams("328.l.34014", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -122,28 +122,28 @@ describe("resource: leagueResource", function() { | |
); | ||
}); | ||
|
||
// players | ||
it("should build a proper url to retrieve players via a league key", function() { | ||
nock("https://fantasysports.yahooapis.com") | ||
.get("/fantasy/v2/league/328.l.34014/players?format=json") | ||
.reply(200, {}); | ||
// // players | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was commented out in the source, so there is nothing to test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ya the tests are a never ending process :P |
||
// it("should build a proper url to retrieve players via a league key", function() { | ||
// nock("https://fantasysports.yahooapis.com") | ||
// .get("/fantasy/v2/league/328.l.34014/players?format=json") | ||
// .reply(200, {}); | ||
|
||
league.players("328.l.34014", null); | ||
// league.players("328.l.34014", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
"https://fantasysports.yahooapis.com/fantasy/v2/league/328.l.34014/players?format=json", | ||
jasmine.any(Function) | ||
); | ||
}); | ||
// expect(yf.api).toHaveBeenCalledWith( | ||
// "GET", | ||
// "https://fantasysports.yahooapis.com/fantasy/v2/league/328.l.34014/players?format=json", | ||
// jasmine.any(Function) | ||
// ); | ||
// }); | ||
|
||
// draft_results | ||
it("should build a proper url to retrieve draft_results via a league key", function() { | ||
nock("https://fantasysports.yahooapis.com") | ||
.get("/fantasy/v2/league/328.l.34014/draft_results?format=json") | ||
.reply(200, {}); | ||
.reply(200, require("./nock-data/leagueDraftResults")); | ||
|
||
league.draft_results("328.l.34014", null); | ||
league.draft_results("328.l.34014", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
@@ -156,9 +156,9 @@ describe("resource: leagueResource", function() { | |
it("should build a proper url to retrieve transactions via a league key", function() { | ||
nock("https://fantasysports.yahooapis.com") | ||
.get("/fantasy/v2/league/328.l.34014/transactions?format=json") | ||
.reply(200, {}); | ||
.reply(200, require("./nock-data/leagueTransaction")); | ||
|
||
league.transactions("328.l.34014", null); | ||
league.transactions("328.l.34014", () => {}); | ||
|
||
expect(yf.api).toHaveBeenCalledWith( | ||
"GET", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jasmine-spec-reporter
has a couple objects. Dunno if it always did