Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I don't know a lot of languages that are being taken over by a superset.
Rather than mocking fetch you could use mws https://mswjs.io/. We have an implementation around it and it's made our tests pretty nice. We have default implementations for every API call that generally just return static data. So in a test if I need the projects and usage apis for a view I can just do mockServer.mockRequests('getProjects', 'getUsage') (that's our implementation not quite how MSW works out of the box, but it's a great tool).
If necessary I will convert the code to JavaScript from TypeScript https://github.com/guest271314/ts-ebml/blob/a7ec9ddd54c2ff7ae7c0d3656864d0388eda238b/lib/ts-ebml-min.js.
Related posts
- Partial: how not to mock the whole world
- How do you test an Axios call to a GraphQL API in React?
- I Write Tests in Go
- How to Successfully Integrate with Legacy APIs Using NodeJS
- What direction can I take to mocking a data structure that is relational on the front-end while I wait for backend endpoints to be created?