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

Descoperă cele mai bune repository-uri open source cu căutare AI.

ExploreazăCăutări recomandateAlternative open-sourceSoftware self-hostedBlogHartă site
ProiectDespreCum realizăm clasamentulPresăServer MCP
LegalConfidențialitateTermeni
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
sapegin avatar

sapegin/jest-cheat-sheet

0
View on GitHub↗
5,428 stele·704 fork-uri·CC0-1.0·14 vizualizări

Jest Cheat Sheet

Acest proiect este un ghid de referință cuprinzător și un cheat sheet pentru framework-ul de testare Jest. Oferă documentație tehnică și exemple de sintaxă pentru scrierea testelor unitare JavaScript, concentrându-se pe aserțiuni, strategii de mocking și configurarea suitei de teste.

Resursa detaliază metode specifice pentru izolarea dependențelor și mocking, inclusiv utilizarea timerelor false, substituțiilor la nivel de modul și verificarea apelurilor de funcții. De asemenea, acoperă fluxuri de lucru specializate, cum ar fi snapshot testing pentru a detecta regresii prin comparații de ieșire serializate.

Ghidul abordează în continuare tiparele de testare asincronă, testarea bazată pe date prin injecție parametrizată și organizarea suitelor de teste prin proceduri de setup și teardown. Include instrucțiuni pentru validarea valorilor datelor, verificarea gestionării excepțiilor și filtrarea execuției testelor.

Features

  • Testing Framework Cheat Sheets - Serves as a comprehensive reference and cheat sheet for writing and running test suites with Jest.
  • Cheat Sheets - Acts as a concise reference guide for Jest assertions, mocking, and test suite configuration.
  • Asynchronous Logic Validation - Guides users on verifying promises and asynchronous patterns to ensure assertions execute correctly.
  • Dependency Mocking - Provides detailed strategies for isolating code by substituting real modules and functions with mocks.
  • Fake Timers - Provides techniques for replacing native clocks with fake timers to execute delayed logic synchronously.
  • Asynchronous Test Handling - Offers a comprehensive guide to verifying promises and time-based logic using asynchronous test patterns.
  • Dependency Mocking - Provides detailed examples of substituting real module dependencies with programmable mock implementations.
  • Timer Mocks - Shows how to control native timer functions to write synchronous tests for time-dependent logic.
  • Value Equality Assertions - Offers a reference for validating data values using strict equality, numeric ranges, and string patterns.
  • Exception Assertions - Provides syntax for asserting that functions throw specific errors or match expected exception messages.
  • Unit Testing - Provides a collection of syntax examples and best practices for writing isolated unit tests in JavaScript.
  • Method Interception Spies - Details how to use spies to track object method calls, getters, and setters without altering original behavior.
  • Test Suite Organization - Details the organization of test suites using grouping and lifecycle setup and teardown procedures.
  • Call-Stack Interceptors - Details how to capture method invocations and arguments using spy functions to verify behavior.
  • Data-Driven Testing - Demonstrates how to use parameterized injection to execute a single test template against multiple input sets.
  • Function Call Tracking - Shows how to track function invocations, count calls, and inspect arguments passed to mocks.
  • Mock State Resetting - Details how to clear internal call history and restore original function implementations between tests.
  • Test Parameterization - Demonstrates how to run the same test logic against multiple data sets using parameterized injection.
  • Mock Behavior Configuration - Explains how to define return values and sequential responses for mock functions to simulate dependency outcomes.
  • Module Registry Resets - Explains how to flush the cached module registry to prevent state leakage between tests.
  • Snapshot Testing - Guides the use of serialized output baselines to detect unexpected changes in components or data.
  • Snapshot Diffing - Provides instructions for comparing serialized output snapshots to detect regressions via string diffing.
  • Mocking and Assertion References - Provides a technical resource for implementing fake timers, module mocks, and data validation.
  • Asynchronous Assertions - Provides guidance on using assertions designed to handle the asynchronous lifecycle and prevent tests from finishing prematurely.
  • Test Execution Filtering - Explains how to isolate or exclude specific tests from a run to focus on particular features.
  • Front End Development - Quick reference for Jest testing framework syntax.
  • Resources and Guides - Quick reference guide for common testing patterns and syntax.

Istoric stele

Graficul istoricului de stele pentru sapegin/jest-cheat-sheetGraficul istoricului de stele pentru sapegin/jest-cheat-sheet

Căutare AI

Explorează mai multe repository-uri excelente

Descrie ce ai nevoie în limbaj simplu — AI-ul sortează mii de proiecte open source selectate în funcție de relevanță.

Start searching with AI

Colecții curatoriate care includ Jest Cheat Sheet

Colecții selectate manual în care apare Jest Cheat Sheet.
  • Fișe de referință rapidă pentru dezvoltatori

Întrebări frecvente

Ce face sapegin/jest-cheat-sheet?

Acest proiect este un ghid de referință cuprinzător și un cheat sheet pentru framework-ul de testare Jest. Oferă documentație tehnică și exemple de sintaxă pentru scrierea testelor unitare JavaScript, concentrându-se pe aserțiuni, strategii de mocking și configurarea suitei de teste.

Care sunt principalele funcționalități ale sapegin/jest-cheat-sheet?

Principalele funcționalități ale sapegin/jest-cheat-sheet sunt: Testing Framework Cheat Sheets, Cheat Sheets, Asynchronous Logic Validation, Dependency Mocking, Fake Timers, Asynchronous Test Handling, Timer Mocks, Value Equality Assertions.

Care sunt câteva alternative open-source pentru sapegin/jest-cheat-sheet?

Alternativele open-source pentru sapegin/jest-cheat-sheet includ: thomhurst/tunit — TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source… substack/tape — Tape is a JavaScript testing framework and assertion library that serves as a test runner for Node.js and browser… sinonjs/sinon — Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit… jestjs/jest — Jest is a JavaScript testing framework designed for writing and running automated test suites to verify the… codeception/codeception — Codeception is a full-stack testing framework for PHP applications that provides a unified interface for unit,… jasmine/jasmine — Jasmine is a JavaScript testing framework and test runner designed for behavior-driven development. It provides a…

Alternative open-source pentru Jest Cheat Sheet

Proiecte open-source similare, clasificate după numărul de funcționalități comune cu Jest Cheat Sheet.
  • thomhurst/tunitAvatar thomhurst

    thomhurst/TUnit

    3,744Vezi pe GitHub↗

    TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source generation for test discovery and mock creation, ensuring compatibility with Native AOT and IL trimming by eliminating the need for runtime reflection and proxies. The framework provides specialized capabilities for integration testing, including the management of distributed application lifecycles, isolated database schemas, and the correlation of telemetry and logs across process boundaries via OTLP. It also includes an HTTP testing utility to intercept network exchanges and mock AP

    C#csharpdotnettest
    Vezi pe GitHub↗3,744
  • substack/tapeAvatar substack

    substack/tape

    5,800Vezi pe GitHub↗

    Tape is a JavaScript testing framework and assertion library that serves as a test runner for Node.js and browser environments. It implements the Test Anything Protocol to provide a standardized, machine-readable format for test results. The project functions as a cross-environment test harness, allowing the same test suites to be executed across both server-side and client-side environments while maintaining a consistent output protocol. Its capabilities include validating value equality and truthiness, verifying exception handling, and coordinating asynchronous workflows. The framework als

    JavaScript
    Vezi pe GitHub↗5,800
  • sinonjs/sinonAvatar sinonjs

    sinonjs/sinon

    9,753Vezi pe GitHub↗

    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 tes

    JavaScript
    Vezi pe GitHub↗9,753
  • jestjs/jestAvatar jestjs

    jestjs/jest

    45,448Vezi pe GitHub↗

    Jest is a JavaScript testing framework designed for writing and running automated test suites to verify the correctness of JavaScript and TypeScript code. It functions as a comprehensive toolset that integrates a test runner, a mocking and spying library, a snapshot testing tool, and a code coverage tool. The framework distinguishes itself through snapshot testing, which records the serialized state of data structures to detect regressions in future executions. It also includes a mocking and spying library for simulating external dependencies and tracking function calls to isolate code during

    TypeScripteasyexpectationfacebook
    Vezi pe GitHub↗45,448
  • Vezi toate cele 30 alternative pentru Jest Cheat Sheet→