DEV Community

Discussion on: Why writing integration tests on a C# API is a productivity booster

Collapse
 
gandalfarcade profile image
Chris Mumford

Cypress is an excellent tool. It provides assurances that you're front end works as defined by your tests. Ideally it'll be accompanied by your unit and integration tests to ensure you are also testing things in isolation, easily mocking certain scenarios that might be harder to achieve using Cypress.

Collapse
 
jwp profile image
John Peters • Edited

Agreed, I have been reluctantly using Karma/Jasmine for unit tests. It's very time consuming, and dependent on knowing all dependencies (which only show when running the test). This includes 3rd party components of which you may not know the dependency chain.

With Cypress' ability to intercept outbound and inbound requests; like Swagger we can inject boundary conditions on the outbound s. But unlike Swagger we can also inject behaviors into what was returned.

Its built-in HTTP client opens up everything else. We're not just limited to interception.

The new way of thinking about (web side) E2E and Unit Tests is that they can be combined into one easy and fun tool. Now we just need to convince all the old timers.