Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix: remove console.log from tests output
Browse files Browse the repository at this point in the history
  • Loading branch information
janmarkusmilan committed Aug 13, 2020
1 parent 1ccd2f6 commit fe3a71a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/__tests__/incidents/hooks/useReportIncident.test.tsx
Expand Up @@ -11,6 +11,7 @@ import executeMutation from '../../test-utils/use-mutation.util'
describe('useReportIncident', () => {
beforeEach(() => {
jest.restoreAllMocks()
console.error = jest.fn()
})

it('should save the incident with correct data', async () => {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/incidents/report/ReportIncident.test.tsx
Expand Up @@ -25,6 +25,7 @@ describe('Report Incident', () => {

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

let setButtonToolBarSpy: any
Expand Down
4 changes: 4 additions & 0 deletions src/__tests__/patients/allergies/NewAllergyModal.test.tsx
Expand Up @@ -24,6 +24,10 @@ describe('New Allergy Modal', () => {
return { wrapper }
}

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

it('should render a modal with the correct labels', () => {
const { wrapper } = setup()

Expand Down
1 change: 1 addition & 0 deletions src/__tests__/patients/hooks/useAddAllergy.test.tsx
Expand Up @@ -9,6 +9,7 @@ import executeMutation from '../../test-utils/use-mutation.util'
describe('use add allergy', () => {
beforeEach(() => {
jest.resetAllMocks()
console.error = jest.fn()
})

it('should throw an error if allergy validation fails', async () => {
Expand Down
6 changes: 1 addition & 5 deletions src/patients/patients-slice.ts
Expand Up @@ -46,13 +46,9 @@ export const fetchPatients = (sortRequest: SortRequest = Unsorted): AppThunk =>
dispatch(fetchPatientsSuccess(patients))
}

export const searchPatients = (
searchString: string,
sortRequest: SortRequest = Unsorted,
): AppThunk => async (dispatch) => {
export const searchPatients = (searchString: string): AppThunk => async (dispatch) => {
dispatch(fetchPatientsStart())

console.log(sortRequest)
let patients
if (searchString.trim() === '') {
patients = await PatientRepository.findAll()
Expand Down

0 comments on commit fe3a71a

Please sign in to comment.