-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Tests pass even if they fail #2287
Comments
Hi @tehkapa I took a look at this and it looks like it is caused by asynchronous tests not using the This can be fixed by going through all tests and making sure all asynchronous operations have closed before moving on to the next test. This would be a fairly big task so it might be worth exploring some other options before deciding how to approach this issue. |
@Tomastomaslol nice finding! Would you love to make a PR? |
Yeah sure. I will take a look at it! 🙂 |
The tests that keep generates the warnings were introduced in 41a97ad. I created a branch that fixes the warnings but I keep having issues with this particular test: https://github.com/HospitalRun/hospitalrun-frontend/blob/master/src/__tests__/patients/search/SearchPatients.test.tsx#L33 Any attempt I tried so far to make sure the test does not have any asynchronous operations running after the test has been run has resulted in failures: Summary of all failing tests
FAIL src/__tests__/patients/search/SearchPatients.test.tsx
● Search Patients › should update view patients table search request when patient search input changes
expect(received).toEqual(expected) // deep equality
- Expected
+ Received
Object {
- "queryString": "someQueryString",
+ "queryString": "",
}
50 |
51 | const patientsTable = wrapper.find(ViewPatientsTable)
> 52 | expect(patientsTable.prop('searchRequest')).toEqual(expectedSearch)
| ^
53 | })
54 | })
55 |
at Object.<anonymous> (src/__tests__/patients/search/SearchPatients.test.tsx:52:49)
Unfortunately, I'm not sure I understand the context well enough to be able to take a decision on how to proceed and make sure the test is verifying the behaviour correctly and get rid of the warnings. Any pointers or help from @jackcmeyer or anyone else would be greatly appreciated. |
Hello, is this still available to work on? |
Absolutely @yuktashres |
#2516 Should fix this |
@jackcmeyer I think this issue should be closed after a few days of reviewing the new testing environment and people have had a chance to mess around with it locally. |
🐛 Bug Report
Reference: https://github.com/HospitalRun/hospitalrun-frontend/runs/974788560?check_suite_focus=true#step:8:138
Cc @fox1t
The text was updated successfully, but these errors were encountered: