backend-application | Public clone of https
kandi X-RAY | backend-application Summary
kandi X-RAY | backend-application Summary
Cattr is an open-source time tracking solution, designed to be flawlessly integrated with your infrastructure. Superpowered with features like built-in screenshot capture and activity detection, it's a great instrument to boost your team's performance straight to the top.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Render the exception .
- Get time intervals .
- Get tasks .
- Apply filter .
- Edit an answer item .
- Update role data .
- Save environment variables .
- Retrieve answers .
- Update the project s source
- Setup the database .
backend-application Key Features
backend-application Examples and Code Snippets
Community Discussions
Trending Discussions on backend-application
QUESTION
This question is a duplicate of Where to write tests for a Frontend/Backend application?, but I wanna get more info if possible.
So, assume that you're writing a new API route /get_something
. Now, you ideally wanna test this endpoint to make sure it's working.
Let's consider that this endpoint is a real production endpoint and it is not trivial to build: it requires a specific authentication with a specific list of inputs that should be serialized in a specific way. This means a simple http.Get()
call is not gonna cut it: you'll need a dedicated function (e.g., client.BuildGetSomethingRequest()
) to call it.
The test (no mocks) should look like this:
- Run a new API request with different inputs
- Assert that the outputs match the expected outputs
Question here is where should the test for this component live?
If you write the test in the backend (i.e., the same codebase the route is gonna be programmed in), you're essentially making a client for that API route (i.e., something like the client.BuildGetSomethingRequest()
we talked about earlier) and you'll be copying the same client when making the frontend.
The other alternative is to functionally test in the API route in the frontend. This way you'll write the request-building code (e.g., client.BuildGetSomethingRequest()
) once and also get the benefit of having a healthy test between frontend and backend.
I personally favor the 2nd approach, but it forces the developer to play between two codebases and it feels weird to write the code in one component, but test it in another.
That being said, if the backend and frontend share the same language (Javascript), it makes sense to couple them, but from a microservices standpoint, this is wrong.
What're your thoughts, folks?
Cheers and thanks
...ANSWER
Answered 2021-Nov-22 at 19:50This answers. Closing as quite subjective and maybe the chatroom is a better place for this.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install backend-application
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page