---
title: "How to use sinon for stubing in mocha node.js?"  
description: "How to use sinon for stubing in mocha node.js?"  
author: "Kyle Flores"  
published: 2016-11-28  
updated: 2016-11-28  
canonical: https://www.mindstick.com/forum/34212/how-to-use-sinon-for-stubing-in-mocha-node-js  
category: "node.js"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# How to use sinon for stubing in mocha node.js?

Hi, I am working on [javascript](https://www.mindstick.com/articles/874/how-to-create-watermark-text-for-textbox-by-using-javascript) [programming](https://www.mindstick.com/articles/12214/web-development-company-in-india-laid-on-the-foundation-of-concrete-java-programming) & it allows me to learn HTML which enhance my [knowledge](https://www.mindstick.com/forum/156160/what-is-google-knowledge-graph) of AJAX, JSON and DOM Objects in Javascript which helps me in my learnings. I have faced an issue that how can I use sinon for stubing in mocha [node.js](https://www.mindstick.com/articles/1499/upload-and-download-file-in-node-js) which is a [feature](https://www.mindstick.com/articles/12788/how-to-boost-sales-using-magento-2-checkout-feature)-rich JavaScript test [framework](https://www.mindstick.com/forum/34615/software-framework-vs-library) running on Node.js making [asynchronous](https://www.mindstick.com/blog/178/synchronous-and-asynchronous-command-execution-in-c-sharp-dot-net) testing simple and fun. I have read related info in almost all javascript [developer](https://www.mindstick.com/articles/157260/variation-between-web-designer-and-web-developer) forums and I also found this [platform](https://www.mindstick.com/articles/13080/wikipedia-the-most-powerful-advertising-platform-of-the-digital-age) very useful. I hope any [tech](https://www.mindstick.com/services/technologies) developer will resolve my issue.


---

Original Source: https://www.mindstick.com/forum/34212/how-to-use-sinon-for-stubing-in-mocha-node-js

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
