Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality. Learn more →
Top 23 TypeScript Mock Projects
-
> For those wondering what the use case is, you must not have tried it. It does take work to set up (with each version that's less), but it can be very nice to test in isolation esp in cases where a component is under a login, the 4th page of a 10 page form, etc. Also obviously if you're working on a component library that ships without an app, Storybook can be your development and/or demo app.
I have worked with storybook extensively over the past couple of years and my team is moving away from it in favour of MSW (https://mswjs.io).
For "4th page of a 10 page form" during the development there's hot reloading which is really stable nowadays and haven't failed me, although I understand that some setups are old and it might be easier to configure Storybook than good hot reloading.
I'm not entirely sure about the testing part of it and I'd be grateful if you could elaborate. I haven't felt the need for some special setup with SB because for unit tests, I can test a deeply nested component separately. For E2E tests, I usually test the whole form.
I agree on the component library part, this is probably the only use case where Storybook is 100% justified, but I'm unconvinced about the
-
mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Mockoon - Used as a logging server instead of using print in the console.
-
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.
-
graphql-tools
:wrench: Utility library for GraphQL to build, stitch and mock GraphQL schemas in the SDL-first approach
-
-
-
mongodb-memory-server
Spinning up mongod in memory for fast tests. If you run tests in parallel this lib helps to spin up dedicated mongodb servers for every test file in MacOS, *nix, Windows or CI environments (in most cases with zero-config).
-
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: Litestar – powerful, flexible, and highly performant Python ASGI framework | news.ycombinator.com | 2024-02-26- Vite/React/Tailwind for the frontend, with [Orval](https://orval.dev/) to generate FE definitions based on the API spec.
For non-API/SPA use-cases, it also has good HTML support, with built-in Jinja and HTMX integrations. The docs are great (https://docs.litestar.dev/latest/ - not quite Django-tier but that's the gold standard), however the reference application is a tad too complex imo (https://github.com/litestar-org/litestar-fullstack).
https://github.com/litestar-org/awesome-litestar has a list of useful extensions - highly recommend trying it out if you are starting a new Python web project.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
-
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
-
jest-mock-extended
Type safe mocking extensions for Jest https://www.npmjs.com/package/jest-mock-extended
-
Project mention: Client-side proxies – a better way to individualise the Internet? (2000) | news.ycombinator.com | 2023-07-23
Interesting how the world has changed since the 2000s here - nowadays the ecosystem is far better, so it's much easier to set up tools to mess around with this, but the use of HTTPS everywhere makes it more difficult in more advanced cases (e.g. you'll often need to fight certificate configuration in individual clients).
In part because of that, browser extensions have become the main way to go for this kind of local web modification, but now there's new restrictions slowly coming in there too.
If you want to mess around with HTTP-level rewriting for yourself though, I maintain a Node.js library for easily writing tiny custom HTTP & HTTPS-intercepting proxies that makes it very easy: https://github.com/httptoolkit/mockttp/. Others have built more specific tooling on top too, like this web page modification proxy: https://github.com/OnkelTem/wmod-proxy
There's a walkthrough for setting up a quick local proxy & rewriting your own browser traffic here: https://httptoolkit.com/blog/javascript-mitm-proxy-mockttp/
-
aws-sdk-client-mock
AWS JavaScript SDK v3 mocks for easy unit testing. 🖋️ Typed 🔬 Tested 📄 Documented 🛠️ Maintained
-
Project mention: Full stack typesafe API-first development for REST | news.ycombinator.com | 2023-10-11
-
Yeah, the last line is 🤮 and one can improve it with utilities like shoehorn hiding all complexity underneath.
-
-
shallow-render
Angular testing made easy with shallow rendering and easy mocking. https://getsaf.github.io/shallow-render
-
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
-
-
-
-
wiretap
The world's coolest API Validation and compliance tool. Validate APIs against OpenAPI specifications and much more (by pb33f)
If you cannot find something to integrate with your existing test suite, consider using Wiretap which can run as a proxy, and handle contract testing of the requests/responses that come through it in testing or staging environments.
-
mock-github
A library to create a local github environment and easily mock github APIs using an octokit like interface
mock-github: https://github.com/kiegroup/mock-github
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
TypeScript Mock related posts
- Storybook 8
- I made "TypeScript Swagger Editor", new type of Swagger UI writing TypeScript code in the browser
- Partial: how not to mock the whole world
- Ask HN: Those making $500+/month on side projects in 2024 – Show and tell
- Polly.js – Record, replay, and stub HTTP interactions
- How to Successfully Integrate with Legacy APIs Using NodeJS
- How do you manage Dependency Injection in Next.js APPS?
-
A note from our sponsor - InfluxDB
www.influxdata.com | 29 Mar 2024
Index
What are some of the best open-source Mock projects in TypeScript? This list will help you:
Project | Stars | |
---|---|---|
1 | msw | 14,635 |
2 | mockoon | 5,793 |
3 | graphql-tools | 5,274 |
4 | falso | 3,097 |
5 | graphql-faker | 2,664 |
6 | mongodb-memory-server | 2,441 |
7 | orval | 2,165 |
8 | Mocky | 1,996 |
9 | smocker | 1,104 |
10 | ng-mocks | 987 |
11 | jest-mock-extended | 772 |
12 | mockttp | 733 |
13 | aws-sdk-client-mock | 703 |
14 | openapi-backend | 571 |
15 | shoehorn | 425 |
16 | observer-spy | 362 |
17 | shallow-render | 267 |
18 | automock | 265 |
19 | jest-dynalite | 147 |
20 | laika | 120 |
21 | strong-mock | 91 |
22 | wiretap | 56 |
23 | mock-github | 53 |