Skip to content

Commit

Permalink
make github mock more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Feb 22, 2025
1 parent 7a507ce commit 7d1a92b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/mocks/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function createGitHubUser(code?: string | null) {
accessToken: `${code}_mock_access_token`,
profile: {
login: faker.internet.username(),
id: faker.string.uuid(),
id: faker.number.int(),
name: faker.person.fullName(),
avatar_url: 'https://github.com/ghost.png',
emails: emails.map((e) => e.email),
Expand Down Expand Up @@ -166,7 +166,7 @@ export const handlers: Array<HttpHandler> = [
if (passthroughGitHub) return passthrough()

const mockUser = (await getGitHubUsers()).find(
(u) => u.profile.id === params.id,
(u) => u.profile.id === Number(params.id),
)
if (mockUser) return json(mockUser.profile)

Expand Down

0 comments on commit 7d1a92b

Please sign in to comment.