Skip to content

Commit

Permalink
test: fix webhook test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarnadas committed Feb 13, 2019
1 parent 8ab6efc commit c840438
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/WebHook.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { WebHook, URL_API } from './WebHook'
import mockAxios from 'jest-mock-axios'

beforeEach(() => {
console.error = jest.fn()
console.warn = jest.fn()
})

afterEach(() => {
Expand Down Expand Up @@ -64,11 +64,11 @@ describe('WebHook', () => {
it('should display error message on wrong apiKey', async () => {
mockAxios.mockError({
response: {
status: 401
status: 400
}
})
await new Promise((resolve) => setTimeout(resolve(), 0))

expect(console.error).toHaveBeenCalledWith('Your API key seems to be wrong. Please check your settings!\nYour server won\'t be publicly visible')
expect(console.warn).toHaveBeenCalledWith('WARNING: Your API key seems to be wrong. Please check your settings!\nYour server won\'t be publicly visible')
})
})

0 comments on commit c840438

Please sign in to comment.