Test spies, stubs and mocks for JavaScript. (by sinonjs)

Sinon.JS Alternatives

Similar projects and alternatives to Sinon.JS

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better Sinon.JS alternative or higher similarity.

Sinon.JS reviews and mentions

Posts with mentions or reviews of Sinon.JS. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-03-07.
  • Express API Testing
    14 projects | /r/node | 7 Mar 2023
    Mocha is a test runner, Chai is an assertion library, Sinon is a mocking library, this normally the combination you would need to use if you choose mocha, but there are others.
  • Alternative to AWS Mock
    2 projects | | 15 Feb 2023
    Instead, use pure functions + dependency inject your stubs (e.g. parameter to function). Also note, no need for Sinon or some other test double library. JavaScript is so good nowadays to easily make objects/classes/functions or any combination thereof on the fly that are terse.
  • Unit testing: What to use, and how?
    5 projects | /r/node | 13 Feb 2023
    I've had some good experiences with Ava + Sinon. I've personally disliked Jest because it seemed to do some weird trickery in the background that prevented me from using ES modules.
  • Can AI help me write tests on legacy code?
    8 projects | | 9 Feb 2023
    🤖 You can use the Mocha testing framework with the Chai assertion library to write tests for your Express controller. You can also use the Sinon library to mock the database calls. This will allow you to test the controller without actually making a call to the database. You can also use the SuperTest library to make HTTP requests to the controller and test the response.
  • Need help writing a jest test that mocks an API call which will update state
    2 projects | /r/react | 29 Sep 2022
    You can use sinon js to create a mock version of your http library (axios) that responds with the data you’re expecting.
  • Unit testing with React and Cypress
    4 projects | | 14 Sep 2022
    Assertions are the checkpoints of our test block that confirm if an automated test has passed or failed. Cypress bundles the Chai, jQuery, and Sinon.JS libraries for assertions. They check the desired, expected application in which the test is running. A complete listing of assertions can be found in the documentation here.
  • Typescript boilerplate test configuration with mocha, chai and sinon
    3 projects | | 17 Aug 2022
    Let's configure tests with mocha, chai and sinon on Typescript in a few steps.
  • 16 Top NodeJS tools to make you a better developer
    8 projects | | 30 May 2022
    SinonJS For testing JavaScript, you can use SinonJS, a stand-alone framework. Compatible with any testing framework, it's compatible with stubs, spies, and mocks. In addition, it's cross-browser compatible and runs on NodeJS on the server. ‍
  • How Do I Stub webpack's require.ensure?
    4 projects | /r/codehunter | 17 Apr 2022
    My test setup is based on Mocha, Chai and Sinon.
  • Unit Testing Essentials for Express API: A Step-by-Step Guide
    3 projects | | 27 Mar 2022
    Standalone test spies, stubs and mocks for JavaScript: Sinon
  • A note from our sponsor - InfluxDB | 29 Sep 2023
    Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge. Learn more →


Basic Sinon.JS repo stats
3 days ago
Updating dependencies is time-consuming.
Solutions like Dependabot or Renovate update but don't merge dependencies. You need to do it manually while it could be fully automated! Add a Merge Queue to your workflow and stop caring about PR management & merging. Try Mergify for free.