Skip to content

Commit

Permalink
Fix for issues #222 (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuron authored and gigobyte committed Nov 21, 2019
1 parent 0bfa5f0 commit 65b390d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions __tests__/getMatches.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import HLTV from '../src/'

test('getMatches', async () => {
expect(await HLTV.getMatches()).not.toHaveLength(0);
}, 30000)
3 changes: 2 additions & 1 deletion src/endpoints/getMatches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export const getMatches = (config: HLTVConfig) => async (): Promise<
})

const upcomingMatches: UpcomingMatch[] = toArray($('.upcoming-match')).map(matchEl => {
const id = Number(matchEl.attr('href').split('/')[2])
const link = matchEl.find('.a-reset');
const id = Number(link.attr('href').split('/')[2])
const date = Number(matchEl.find('div.time').attr('data-unix')) || undefined
const title = matchEl.find('.placeholder-text-cell').text() || undefined
const stars = matchEl.find('.stars i').length
Expand Down

0 comments on commit 65b390d

Please sign in to comment.