Skip to content

Commit

Permalink
chore: Fix construct-error tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Feb 1, 2023
1 parent 990b870 commit 1fef624
Showing 1 changed file with 9 additions and 14 deletions.
Expand Up @@ -2,21 +2,16 @@ import constructError from "../construct-error"
import { errorMap } from "../error-map"
import { Level } from "../types"

let log
let processExit
beforeEach(() => {
log = jest.spyOn(console, `log`).mockImplementation(() => {})
processExit = (
jest.spyOn(process, `exit`) as unknown as jest.Mock
).mockImplementation(() => {})
const processExit = (
jest.spyOn(process, `exit`) as unknown as jest.Mock
).mockImplementation(() => {})
const log = (
jest.spyOn(console, `log`) as unknown as jest.Mock
).mockImplementation(() => {})

log.mockReset()
processExit.mockReset()
})

afterAll(() => {
;(console.log as jest.Mock).mockClear()
;(process.exit as unknown as jest.Mock).mockClear()
afterEach(() => {
log.mockClear()
processExit.mockClear()
})

test(`it exits on invalid error schema`, () => {
Expand Down

0 comments on commit 1fef624

Please sign in to comment.