<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/javascript-api-mocking-techniques-l4nbumrah" -->

---
title: JavaScript API Mocking Techniques | daily.dev
description: API Mocking Mocking is a client-side mocking framework that mocks the API in the browser by using the Pretender library. It has many built-in tools:...
canonical: https://daily.dev/posts/javascript-api-mocking-techniques-l4nbumrah
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: JavaScript API Mocking Techniques | daily.dev
og:description: API Mocking Mocking is a client-side mocking framework that mocks the API in the browser by using the Pretender library. It has many built-in tools:...
og:url: https://daily.dev/posts/javascript-api-mocking-techniques-l4nbumrah
og:image: https://api.daily.dev/og/posts/L4nbuMrah.png
og:image:alt: JavaScript API Mocking Techniques
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript API Mocking Techniques

**[Syncfusion](https://daily.dev/sources/syncfusion)** · [@sureshmohan](https://daily.dev/sureshmohan) · 8 min read · 85 upvotes · 1 comments

## Summary

API Mocking Mocking is a client-side mocking framework that mocks the API in the browser by using the Pretender library. It has many built-in tools: serializer, route handlers, database, models, fixtures, and factories. It enables emulating dynamic behavior between the front end and back end, rather than mocking the same response over and over again by hitting an endpoint.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.syncfusion.com/blogs/post/javascript-api-mocking-techniques.aspx>

## Community discussion

Top comments from developers on daily.dev.

**@devvsakib** · 1 upvotes

> great

---

Tags: [#react](https://daily.dev/tags/react), [#javascript](https://daily.dev/tags/javascript), [#testing](https://daily.dev/tags/testing), [#rest-api](https://daily.dev/tags/rest-api), [#axios](https://daily.dev/tags/axios)

[View this post on daily.dev](https://daily.dev/posts/javascript-api-mocking-techniques-l4nbumrah)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"JavaScript API Mocking Techniques","url":"https://daily.dev/posts/javascript-api-mocking-techniques-l4nbumrah","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/javascript-api-mocking-techniques-l4nbumrah"},"datePublished":"2022-09-15T11:05:19.554Z","dateModified":"2022-09-15T11:05:19.478Z","description":"API Mocking Mocking is a client-side mocking framework that mocks the API in the browser by using the Pretender library. It has many built-in tools:...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/78a76c3636a1f949dc98deaec91b6e51","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/78a76c3636a1f949dc98deaec91b6e51","isAccessibleForFree":true,"articleSection":"Syncfusion","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Suresh Mohan","url":"https://daily.dev/sureshmohan","image":"https://lh3.googleusercontent.com/a-/AOh14GiORQm3okwNI9Z01tYDa4YELb6j3F-hP-fbPVbSves=s100","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":1970}},"commentCount":1,"discussionUrl":"https://daily.dev/posts/javascript-api-mocking-techniques-l4nbumrah","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":85},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"react,javascript,testing,rest-api,axios","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Syncfusion","item":"https://daily.dev/sources/syncfusion"},{"@type":"ListItem","position":3,"name":"JavaScript API Mocking Techniques"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/javascript-api-mocking-techniques-l4nbumrah","comment":[{"@type":"Comment","text":"great","datePublished":"2022-09-15T18:27:16.725Z","url":"https://daily.dev/posts/L4nbuMrah#c--8g5_P2qt","author":{"@type":"Person","name":"Sakib Ahmed","url":"https://daily.dev/devvsakib","image":"https://avatars.githubusercontent.com/u/88339569?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

