SaaSHub helps you find the best software and product alternatives Learn more โ
Top 23 TypeScript Mock Projects
-
One of the core functionalities I wanted to test involved integrating with the Gemini API. Since I didnโt want to rely on the live API for testing, I decided to mock the API calls. Initially, I tried using Nock, but I ran into issues because it didnโt work well with Nodeโs default fetch implementation. It seemed that the Gemini library was using the default fetch instead of a third-party fetch implementation, which caused the mock to fail. After several attempts without success, I switched to another library called MSW (Mock Service Worker). Although it required a bit more setup to create a mock server, it worked flawlessly on the first try. I crafted an example response based on how the Gemini API would respond, which allowed me to test the refactored functionality.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
I hate mocks. I tend to work in languages which allow side-effects, and with developers who do not follow Pure Core, Imperative Shell. So anything I can do to learn more about my enemy, and how to manage it, is a good use of time, and Mockoon is another one of those mock creators.
-
graphql-tools
:wrench: Utility library for GraphQL to build, stitch and mock GraphQL schemas in the SDL-first approach
-
-
orval
orval is able to generate client with appropriate type-signatures (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in yaml or json formats. ๐บ
Project mention: ๐ Autogeneration of data fetching functions and typing with Orval | dev.to | 2024-10-04Orval is a tool for generating client code for RESTful APIs based on OpenAPI specifications. Its official documentation can be found here.
-
-
mongodb-memory-server
Manage & spin up mongodb server binaries with zero(or slight) configuration for tests.
-
-
Project mention: Smocker: Smocker is a simple and efficient HTTP mock server and proxy | news.ycombinator.com | 2024-02-21
-
ng-mocks
Angular testing library for mocking components, directives, pipes, services and facilitating TestBed setup
providing the mocks might require a lot of cumbersome code in some cases. It makes sense to use extra tools to simplify it. For instance, ng-mocks for Angular
-
jest-mock-extended
Type safe mocking extensions for Jest https://www.npmjs.com/package/jest-mock-extended
How large is your project?
Without process isolation we got 6x speedup vs. jest! But it is difficult to ensure a clean slate between our test suites (~40 suites)
We are also using some helpers to mock, e.g https://github.com/marchaos/jest-mock-extended - its such helper libraries im concerned about.
-
aws-sdk-client-mock
AWS JavaScript SDK v3 mocks for easy unit testing. ๐๏ธ Typed ๐ฌ Tested ๐ Documented ๐ ๏ธ Maintained
-
-
-
Yeah, the last line is ๐คฎ and one can improve it with utilities like shoehorn hiding all complexity underneath.
-
Project mention: Major updates from the open source community: Release Radar ยท June 2024 | dev.to | 2024-07-05
Want a browser library that intercepts AJAX calls to mock a REST server based on JSON data? Then look no further than FakeRest. The new update has a tonne of new features including added support for Mock Service Worker (MSW), string identifiers, custom ID generation, and many more abilities. Check out the release notes for all the changes.
-
-
-
suites
A testing meta-framework that simplifies unit testing by reducing boilerplate code and enabling developers to build comprehensive and reliable test suites
Project mention: Unit Test Like a Pro: Automock, My Open Source Answer to Mocking Frustration ๐ค๐ก๐ญ | dev.to | 2023-12-12๐ Here are some links to check out: ๐ GitHub: https://github.com/automock/automock ๐ Automock's NestJS Official Recipe: https://docs.nestjs.com/recipes/automock ๐ฆ NPM: https://www.npmjs.com/package/@automock/jest ๐ Docs Website: https://automock.dev
-
shallow-render
Angular testing made easy with shallow rendering and easy mocking. https://getsaf.github.io/shallow-render
-
-
-
TypeScript Mock discussion
TypeScript Mock related posts
-
Lab 7 - Jest Testing
-
Testing Troubles with Jest and ESM and how to fix it
-
Server Side Mocking for Playwright in NextJS (App Router) using Mock Service Worker
-
The ultimate Electron app with Next.js and React Server Components
-
The most valuable developer in the team is โฆ
-
Zustand adoption guide: Overview, examples, and alternatives
-
Integration testing of Redux-components with MSW
-
A note from our sponsor - SaaSHub
www.saashub.com | 4 Dec 2024
Index
What are some of the best open-source Mock projects in TypeScript? This list will help you:
Project | Stars | |
---|---|---|
1 | msw | 16,023 |
2 | mockoon | 6,598 |
3 | graphql-tools | 5,356 |
4 | falso | 3,220 |
5 | orval | 3,244 |
6 | graphql-faker | 2,694 |
7 | mongodb-memory-server | 2,608 |
8 | Mocky | 2,064 |
9 | smocker | 1,162 |
10 | ng-mocks | 1,063 |
11 | jest-mock-extended | 854 |
12 | aws-sdk-client-mock | 813 |
13 | mockttp | 787 |
14 | openapi-backend | 625 |
15 | shoehorn | 459 |
16 | FakeRest | 439 |
17 | msw-storybook-addon | 410 |
18 | observer-spy | 377 |
19 | suites | 374 |
20 | shallow-render | 273 |
21 | jest-dynalite | 148 |
22 | laika | 124 |
23 | strong-mock | 101 |