TypeScript Mock

Open-source TypeScript projects categorized as Mock

Top 23 TypeScript Mock Projects

  • msw

    Industry standard API mocking for JavaScript.

    Project mention: Testing Troubles with Jest and ESM and how to fix it | dev.to | 2024-11-08

    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

    SaaSHub logo
  • mockoon

    Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.

    Project mention: Thoughts on ThoughtWorks Radar 2024 | dev.to | 2024-11-02

    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

  • falso

    All the Fake Data for All Your Real Needs ๐Ÿ™‚

  • 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-04

    Orval is a tool for generating client code for RESTful APIs based on OpenAPI specifications. Its official documentation can be found here.

  • graphql-faker

    ๐ŸŽฒ Mock or extend your GraphQL API with faked data. No coding required.

  • mongodb-memory-server

    Manage & spin up mongodb server binaries with zero(or slight) configuration for tests.

  • Mocky

    Generate custom HTTP responses, the simpler way to test your Web Services

  • smocker

    Smocker is a simple and efficient HTTP mock server and proxy

    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

    Project mention: The most valuable developer in the team is โ€ฆ | dev.to | 2024-09-04

    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

    Project mention: Vitest vs. Jest: why we are betting on Vitest | news.ycombinator.com | 2024-11-26

    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

  • mockttp

    Powerful friendly HTTP mock server & proxy library

  • openapi-backend

    Build, Validate, Route, Authenticate and Mock using OpenAPI

  • shoehorn

    Work seamlessly with partial mocks in TypeScript.

    Project mention: Partial: how not to mock the whole world | dev.to | 2024-02-08

    Yeah, the last line is ๐Ÿคฎ and one can improve it with utilities like shoehorn hiding all complexity underneath.

  • FakeRest

    Patch fetch/XMLHttpRequest to fake a REST API server in the browser, based on JSON data.

    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.

  • msw-storybook-addon

    Mock API requests in Storybook with Mock Service Worker.

  • observer-spy

    This library makes RxJS Observables testing easy!

  • 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

  • jest-dynalite

    Jest preset to run Dynalite (DynamoDB local) per test runner

  • laika

    Log, test, intercept and modify Apollo Client's operations (by zendesk)

  • strong-mock

    Type safe mocking library for TypeScript

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

TypeScript Mock discussion

Log in or Post with

TypeScript Mock related posts

  • Lab 7 - Jest Testing

    2 projects | dev.to | 8 Nov 2024
  • Testing Troubles with Jest and ESM and how to fix it

    3 projects | dev.to | 8 Nov 2024
  • Server Side Mocking for Playwright in NextJS (App Router) using Mock Service Worker

    3 projects | dev.to | 30 Oct 2024
  • The ultimate Electron app with Next.js and React Server Components

    6 projects | dev.to | 21 Oct 2024
  • The most valuable developer in the team is โ€ฆ

    1 project | dev.to | 4 Sep 2024
  • Zustand adoption guide: Overview, examples, and alternatives

    3 projects | dev.to | 4 Sep 2024
  • Integration testing of Redux-components with MSW

    2 projects | dev.to | 14 Jun 2024
  • A note from our sponsor - SaaSHub
    www.saashub.com | 4 Dec 2024
    SaaSHub helps you find the best software and product alternatives Learn more โ†’

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

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com