awesome-repositories.com
Blog
MCP
awesome-repositories.com

Descubre los mejores repositorios open-source con nuestra búsqueda potenciada por IA.

ExplorarBúsquedas curadasAlternativas open-sourceSoftware autohospedableBlogMapa del sitio
ProyectoAcerca deCómo clasificamosPrensaServidor MCP
Aviso legalPrivacidadTérminos
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
sinonjs avatar

sinonjs/sinon

0
View on GitHub↗
9,753 estrellas·793 forks·JavaScript·10 vistassinonjs.org↗

Sinon

Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit testing. It provides a collection of spies, stubs, and mocks that replace real function implementations and object methods with controlled substitutes.

The project includes a specialized fake timer library for overriding the system clock, allowing the simulation of time progression to trigger timeouts and intervals without waiting for real-time delays. It also features a test sandbox mechanism to group multiple fakes together, ensuring the original state is restored between test cases to prevent environment leakage.

The toolkit covers a broad range of verification capabilities, including recording function call arguments and invocation counts, simulating dependency behaviors through predefined return values or errors, and verifying object interactions. It further supports intercepting network requests and stubbing object instances and accessors.

Features

  • Mocking Frameworks - Serves as a comprehensive framework for creating simulated objects and stubbing method calls.
  • Controlled Interface Fakes - Allows replacing function implementations to return specific values or trigger errors for controlled testing.
  • Test Double Implementations - Implements a comprehensive set of spies, stubs, and mocks to replace real dependencies.
  • Argument Constraint Matchers - Provides logic for validating function call arguments against custom predicates and constraints during assertions.
  • Method Interception Proxies - Uses dynamic proxy systems to wrap original methods and record metadata or control return values.
  • Test-Time - Returns specific values, throws errors, or resolves promises by overriding existing functions.
  • Interaction Verification Utilities - Enables recording and asserting that object methods are called with expected arguments and in the correct order.
  • Fake Timers - Trigger timeouts and intervals instantly by replacing the system clock with a fake timer to avoid waiting for real time.
  • Function Call Tracking - Maintains an internal ledger of arguments, contexts, and return values for every invocation of a wrapped function.
  • Function Behavior Replacement - Simulates specific dependencies by intercepting function calls and returning predefined values or throwing errors.
  • Test Isolation - Prevents test leakage by grouping multiple fakes into a sandbox that restores the original state.
  • Global Object Interception - Implements the replacement of native JavaScript clock and timer functions to simulate time progression.
  • Mocking and Spying Libraries - Provides a full toolkit of spies, stubs, and mocks for isolation and interaction tracking.
  • Object Interaction Verification - Checks that specific methods on an object are called with expected arguments and in the correct order.
  • Dependency Mocking - Replaces module dependencies and network calls with controlled substitutes to simulate specific behaviors.
  • Timer Mocks - Allows overriding native timers to control time-based execution and trigger timeouts instantly.
  • Test Sandbox Restoration - Ships a sandbox mechanism that tracks all modified properties and restores original behavior via a single cleanup call.
  • Test Spying Utilities - Tracks function call arguments, return values, and invocation counts to verify object interactions.
  • Virtual Time Testing - Simulates the passage of time by overriding the system clock to trigger timers without waiting in real-time.
  • Accessor Stubbing - Controls or monitors access to specific properties by replacing getters and setters on objects.
  • Fake Timer Utilities - Offers a specialized library to override the system clock for instant timeout and interval triggering.
  • Mock Expectation Definitions - Provides syntax for defining anticipated method calls and return sequences on mock objects.
  • API Request Mocking - Mocks server responses and inspects outgoing requests by simulating a network environment.
  • Test State Sandboxes - Includes a sandbox mechanism to group fakes and automatically restore original behavior between tests.
  • Instance-Level Stubbing - Replaces every method in a constructor instance with a stub to simulate a full object.
  • Instance Stubbing - Provides the ability to intercept object instantiation and automatically stub every method of the resulting instance.
  • Unit Testing - Provides the essential tooling for isolating units of code and verifying their logic in JavaScript.
  • Assertions and Coverage - Spies, stubs, and mocks for JavaScript testing.
  • Testing and Quality Assurance - Test spies, stubs, and mocks for JavaScript.
  • Frameworks de pruebas - Mocking library with spies, stubs, and mocks.

Historial de estrellas

Gráfico del historial de estrellas de sinonjs/sinonGráfico del historial de estrellas de sinonjs/sinon

Búsqueda con IA

Explora más repositorios increíbles

Describe lo que necesitas en lenguaje sencillo: la IA clasifica miles de proyectos open-source curados por relevancia.

Start searching with AI

Alternativas open-source a Sinon

Proyectos open-source similares, clasificados según cuántas características comparten con Sinon.
  • phpspec/prophecyAvatar de phpspec

    phpspec/prophecy

    8,480Ver en GitHub↗

    Prophecy is a PHP mocking framework and test double library used to simulate object dependencies during unit testing. It serves as a behavioral testing tool for creating mocks, stubs, and dummies to isolate code and ensure predictable test results. The framework enables interaction verification by tracking method call counts and arguments to validate that specific interactions occurred. It supports defining specific return values or custom logic for method calls to simulate various execution scenarios. The library provides capabilities for argument matching based on type or value, interactio

    PHP
    Ver en GitHub↗8,480
  • sapegin/jest-cheat-sheetAvatar de sapegin

    sapegin/jest-cheat-sheet

    5,428Ver en GitHub↗

    This project is a comprehensive reference guide and cheat sheet for the Jest testing framework. It provides technical documentation and syntax examples for writing JavaScript unit tests, focusing on assertions, mocking strategies, and test suite configuration. The resource details specific methods for dependency isolation and mocking, including the use of fake timers, module-level substitutions, and function call verification. It also covers specialized workflows such as snapshot testing to detect regressions via serialized output comparisons. The guide further addresses asynchronous test pa

    cheatsheetjesttesting
    Ver en GitHub↗5,428
  • vitest-dev/vitestAvatar de vitest-dev

    vitest-dev/vitest

    15,970Ver en GitHub↗

    Vitest is a high-performance testing framework designed for JavaScript and TypeScript applications. It provides an integrated environment that supports unit, integration, and browser-based testing, allowing developers to execute test suites natively without requiring separate build steps or complex configuration. The project distinguishes itself through a highly optimized execution model that leverages worker-thread isolation and on-demand module transformation to provide rapid feedback. It includes a comprehensive suite of mocking and spying utilities that allow for the interception of depen

    TypeScripttesttesting-toolsvite
    Ver en GitHub↗15,970
  • jasmine/jasmineAvatar de jasmine

    jasmine/jasmine

    15,824Ver en GitHub↗

    Jasmine is a JavaScript testing framework and test runner designed for behavior-driven development. It provides a comprehensive toolset for writing and executing descriptive test suites that verify code behavior in both web browsers and Node.js environments. The framework is distinguished by its integrated mocking library, which allows for dependency isolation through spies and stubs, as well as the ability to simulate time and timing functions to test asynchronous logic synchronously. It also includes a mechanism to enforce test uniqueness, preventing duplicate names for tests and suites. I

    JavaScript
    Ver en GitHub↗15,824
Ver las 30 alternativas a Sinon→

Preguntas frecuentes

¿Qué hace sinonjs/sinon?

Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit testing. It provides a collection of spies, stubs, and mocks that replace real function implementations and object methods with controlled substitutes.

¿Cuáles son las características principales de sinonjs/sinon?

Las características principales de sinonjs/sinon son: Mocking Frameworks, Controlled Interface Fakes, Test Double Implementations, Argument Constraint Matchers, Method Interception Proxies, Test-Time, Interaction Verification Utilities, Fake Timers.

¿Qué alternativas de código abierto existen para sinonjs/sinon?

Las alternativas de código abierto para sinonjs/sinon incluyen: phpspec/prophecy — Prophecy is a PHP mocking framework and test double library used to simulate object dependencies during unit testing.… sapegin/jest-cheat-sheet — This project is a comprehensive reference guide and cheat sheet for the Jest testing framework. It provides technical… vitest-dev/vitest — Vitest is a high-performance testing framework designed for JavaScript and TypeScript applications. It provides an… jasmine/jasmine — Jasmine is a JavaScript testing framework and test runner designed for behavior-driven development. It provides a… moq/moq4 — Moq4 is a .NET mocking framework used to create simulated implementations of interfaces and abstract classes. It… jestjs/jest — Jest is a JavaScript testing framework designed for writing and running automated test suites to verify the…