Skip to content

Commit

Permalink
Merge pull request #229 from mkreiser/team-name-update
Browse files Browse the repository at this point in the history
Update Team object with improved team name mapping
  • Loading branch information
mkreiser authored Oct 21, 2023
2 parents c6d4ee9 + 0196a66 commit 5bd6c09
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "espn-fantasy-football-api",
"version": "1.1.0",
"version": "1.1.1",
"description": "A Javascript API to connect to ESPN's fantasy football API",
"main": "web.js",
"files": [
Expand Down
5 changes: 1 addition & 4 deletions src/team/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ class Team extends BaseCacheableObject {
static responseMap = {
id: 'id',
abbreviation: 'abbrev',
name: {
key: 'location',
manualParse: (responseData, data) => `${_.trim(data.location)} ${_.trim(data.nickname)}`
},
name: 'name',
logoURL: 'logo',
wavierRank: 'wavierRank',

Expand Down
15 changes: 0 additions & 15 deletions src/team/team.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,6 @@ describe('Team', () => {
describe('responseMap', () => {
const buildTeam = (data, options) => Team.buildFromServer(data, options);

describe('name', () => {
describe('manualParse', () => {
test('interpolates location and nickname into a single string', () => {
const data = {
location: ' First ',
nickname: ' Last ',
name: 'This is not used'
};
const team = buildTeam(data);

expect(team.name).toBe(`${_.trim(data.location)} ${_.trim(data.nickname)}`);
});
});
});

describe('roster', () => {
describe('manualParse', () => {
test('returns an array of players', () => {
Expand Down

0 comments on commit 5bd6c09

Please sign in to comment.