Skip to content

Commit

Permalink
clean up test with a minor refactor to delete the ts-ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamConnatser authored and fiatjaf committed Oct 24, 2023
1 parent 318e3f8 commit a2a1556
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,8 @@ test('list()', async () => {
)

// the actual received number will be greater than 2, but there will be no duplicates
expect(events.length).toEqual(
events
.map(evt => evt.id)
// @ts-ignore ???
.reduce((acc, n) => (acc.indexOf(n) !== -1 ? acc : [...acc, n]), []).length,
)
const uniqueEventCount = new Set(events.map(evt => evt.id)).size
expect(events.length).toEqual(uniqueEventCount)

let relaysForAllEvents = events.map(event => pool.seenOn(event.id)).reduce((acc, n) => acc.concat(n), [])
expect(relaysForAllEvents.length).toBeGreaterThanOrEqual(events.length)
Expand Down

0 comments on commit a2a1556

Please sign in to comment.