Skip to content

Commit

Permalink
update console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-sentry committed May 13, 2024
1 parent e57e62a commit 5ef5686
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/services/repo/hooks.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ afterEach(() => {
})
afterAll(() => server.close())

console.error = () => {}

const provider = 'gh'
const owner = 'cool-guy'
const repo = 'cool-repo'
Expand All @@ -63,12 +61,17 @@ describe('useRepo', () => {
},
}

beforeEach(() => {
setup(badData)
beforeAll(() => {
console.error = () => {}
})

afterAll(() => {
jest.resetAllMocks()
})

describe('when incorrect data is loaded', () => {
it('throws an error', async () => {
setup(badData)
const { result } = renderHook(
() => useRepo({ provider, owner, repo }),
{
Expand Down Expand Up @@ -304,6 +307,13 @@ describe('useRepoBackfilled', () => {
})

describe('can throw errors', () => {
beforeAll(() => {
console.error = () => {}
})

afterAll(() => {
jest.resetAllMocks()
})
it('can return unsuccessful parse error', async () => {
setup({ isUnsuccessfulParseError: true })
const { result } = renderHook(() => useRepoBackfilled(), {
Expand Down

0 comments on commit 5ef5686

Please sign in to comment.