strong-mock
data
strong-mock | data | |
---|---|---|
4 | 5 | |
92 | 746 | |
- | 3.2% | |
7.5 | 6.5 | |
13 days ago | 5 months ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
strong-mock
-
libraries you are happy that you discovered them
Shameless plug, but feel free to try https://github.com/NiGhTTraX/strong-mock as an alternative.
- strong-mock: Type safe mocking library for TypeScript
-
"as unknown as Promise<Response>" if you don't want to mock the whole Response object
If checking that getData is called using the correct input, consider using strong-mock.
-
How do you test an Axios call to a GraphQL API in React?
Depending on how you want to check the call, you might want to use a spying library (sinon, jest.fn etc). Check out strong-mock if you're using TypeScript.
data
- 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?
- What direction can I take to mock a (relational?) data-structure on the front-end while I wait for backend endpoints to be created?
-
Mock Service Worker is awesome
It supports both REST and GraphQL APIs, it can delay the response of mocked API endpoints so the endpoint feels more real-life, it has it's own in-memory database with @msw/data package for more complex querying (e.g, searching, sorting), it can also run mocks in NodeJS environment instead of Service Worker (really useful for testing). Next, let's take a look at which problems msw can solve and how.
-
Why I migrated to msw from json-server?
Next steps mswjs/data
-
Announcing "@mswjs/data"—data modeling library for testing JavaScript applications
Today we are proud to announce the Data library—a standalone package to model and query data in your tests and beyond. Although the project is at the early stage of development and doesn't solve every problem right away, letting you try it out and gather your feedback is crucial for us to refine and shape the future experience.
What are some alternatives?
ts-mockito - Mocking library for TypeScript
msw - Seamless REST/GraphQL API mocking library for browser and Node.js.
mock-inspect - Mocks network requests and allows you to make assertions about how these requests happened. Supports auto-mocking of graphQL requests given a valid schema.
ng-mocks - Angular testing library for mocking components, directives, pipes, services and facilitating TestBed setup
wonka - 🎩 A tiny but capable push & pull stream library for TypeScript and Flow
json-server - Get a full fake REST API with zero coding in less than 30 seconds (seriously)
camouflage - Camouflage is a backend mocking tool for HTTP, gRPC, Websockets and Thrift protocols, which helps you carry out your front end prototyping, unit testing, functional/performance testing in silos, in absence of one or more Microservices/APIs.
shoehorn - Work seamlessly with partial mocks in TypeScript.
Faker.js - What really happened with Aaron Swartz?
fp-ts - Functional programming in TypeScript
mockoon - Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.