What's the recommended way of reusing tests? Example: there are 3 endpoints, and I want to test if all three of them handle authorization correctly, and the tests are the same, so I want to define the tests and reuse them, similar to rspec shared examples https://rspec.info/features/3-12/rspec-core/example-groups/shared-examples/
e
Eugen Martynov
08/14/2023, 11:39 AM
Is your authorisation handling code abstracted and reused for all end point?
e
ebonet
08/14/2023, 11:42 AM
yes. I could test the authorisation code, and then mock on the endpoint, which is good enough for unit test, but not for integration tests
e
Eugen Martynov
08/14/2023, 11:58 AM
Oke, up to you! As for me having unit tests and one integration test is enough to be comfortable with the regression catches.
c
christophsturm
08/14/2023, 7:59 PM
probably depends on the test runner that you are using