codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
24 stars 24 forks source link

Bug: Test passes if set to both `expect(...)` and `expect(...).not` #556

Closed milofultz closed 7 months ago

milofultz commented 7 months ago

Bug Description:

I made a script to change all the expect calls in all the tests to expect().not and vice versa to see if there were any tests that passed on both. This could potentially mean that we are not correctly testing the desired outcomes. Only one was tripped:

test/hooks/useMessageList.test.jsx :: describe('useMessageList :: it('Returns inbox list if list is found, but an empty list when 0 messages'

Reproduction Steps:

  1. Duplicate the lines with expect calls.
  2. In the duplicated line, flip the not (add .not where it does not exist on the expect calls, and remove .not where it does exist).
milofultz commented 7 months ago

Apparently this was flaky or something, because now it works fine 🙃