# jquery/qunit

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/jquery-qunit).**

4,035 stars · 774 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/jquery/qunit
- Homepage: https://qunitjs.com
- awesome-repositories: https://awesome-repositories.com/repository/jquery-qunit.md

## Description

QUnit is a JavaScript unit testing framework designed to verify code behavior using assertions and lifecycle hooks across browsers and server runtimes. It functions as a browser-based test runner with an HTML interface for reporting results, an asynchronous test orchestrator for coordinating callbacks, and a utility for isolating and verifying document object model changes.

The framework distinguishes itself through specialized DOM testing capabilities, allowing for the isolation and resetting of the document object model between tests to ensure atomicity. It also features a system for detecting global state leaks by monitoring the window object and provides the ability to execute test suites in headless environments for background automation.

The project covers a broad range of testing capabilities, including asynchronous workflow validation, cross-runtime compatibility testing, and the creation of custom assertions. It supports test organization through modules, the execution of setup and teardown lifecycle hooks, and the generation of code coverage and standardized test reports.

Users can execute tests via a browser interface or a command-line terminal with support for file watching and programmatic test filtering.

## Tags

### Testing & Quality Assurance

- [Unit Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/unit-testing-frameworks.md) — Provides a full framework for defining and executing automated unit tests to verify code logic and correctness. ([source](https://qunitjs.com/intro/))
- [Asynchronous Logic Validation](https://awesome-repositories.com/f/testing-quality-assurance/asynchronous-logic-validation.md) — Provides an orchestrator to verify the execution order and completion of asynchronous callbacks and promises.
- [Asynchronous Test Execution](https://awesome-repositories.com/f/testing-quality-assurance/asynchronous-test-execution.md) — Manages the execution flow of tests that rely on promises or callbacks, delaying completion until a trigger occurs. ([source](https://qunitjs.com/upgrade-guide-2.x/))
- [Behavioral Assertions](https://awesome-repositories.com/f/testing-quality-assurance/behavioral-assertions.md) — Check for specific outcomes like partial object matches or expected exceptions to validate internal logic. ([source](https://qunitjs.com/intro/))
- [DOM Testing Utilities](https://awesome-repositories.com/f/testing-quality-assurance/dom-testing-utilities.md) — Includes utilities for isolating and verifying document object model changes during unit testing.
- [Test Isolation](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-isolation.md) — Ensures test execution environments remain independent by resetting internal state between individual test cases.
- [Test Result Reporters](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-reporters/test-result-reporters.md) — Displays test outcomes via a browser-based HTML interface including assertion diffs and status. ([source](https://qunitjs.com/browser/))
- [HTML Dashboard Reports](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-reporters/test-result-reporters/html-dashboard-reports.md) — Renders test outcomes and assertion failures through an interactive visual HTML dashboard.
- [Element State Assertions](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/assertion-extensions-modes/asynchronous-interaction-utilities/element-state-assertions.md) — Provides high-level assertions to verify the state and properties of HTML elements. ([source](https://qunitjs.com/plugins/))
- [Test Grouping Utilities](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-grouping-utilities.md) — Organizes collections of tests into modules to manage shared setup and maintain logical separation. ([source](https://qunitjs.com/intro/))
- [Test Lifecycle Hooks](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-lifecycle-hooks.md) — Provides mechanisms for executing setup and teardown logic before or after the execution of tests and modules. ([source](https://qunitjs.com/upgrade-guide-2.x/))
- [JavaScript Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/javascript-testing-frameworks.md) — Provides a dedicated framework for writing and running assertion-based tests within JavaScript environments.
- [Browser and UI Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/browser-and-ui-testing.md) — Offers specialized tools for verifying HTML element rendering and behavior by isolating the DOM.
- [Test Suite Runners](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/execution-and-infrastructure/test-execution-runners/test-suite-runners.md) — Ships a browser-based runner with an HTML interface for reporting results and debugging failures.
- [Test Lifecycle Hooks](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-orchestration/test-setup-orchestrators/test-lifecycle-hooks.md) — Implements setup and teardown hooks to maintain a consistent environment for every test.
- [Headless Browser Test Suites](https://awesome-repositories.com/f/testing-quality-assurance/automated-test-suites/headless-browser-test-suites.md) — Supports integration into CI pipelines through headless browser execution and standardized reporting.
- [Code Coverage Analysis](https://awesome-repositories.com/f/testing-quality-assurance/code-coverage-analysis.md) — Integrates tools to track and measure which parts of the codebase are exercised by the test suite. ([source](https://qunitjs.com/cli/))
- [Cross-Environment Test Execution](https://awesome-repositories.com/f/testing-quality-assurance/cross-environment-test-execution.md) — Allows the same test suite to be executed across different runtimes, including browsers and server environments. ([source](https://qunitjs.com/about/))
- [Assertion Registries](https://awesome-repositories.com/f/testing-quality-assurance/custom-assertion-predicates/assertion-registries.md) — Provides a pluggable registry allowing developers to define and use custom validation functions.
- [Custom Assertions](https://awesome-repositories.com/f/testing-quality-assurance/custom-assertions.md) — Allows developers to define new validation functions that push results directly into the active test context. ([source](https://qunitjs.com/upgrade-guide-2.x/))
- [Custom Test Reporters](https://awesome-repositories.com/f/testing-quality-assurance/custom-test-reporters.md) — Provides pluggable interfaces to integrate external scripts that format or deliver test results. ([source](https://qunitjs.com/blog/))
- [Testing Framework Extenders](https://awesome-repositories.com/f/testing-quality-assurance/custom-test-reporters/testing-framework-extenders.md) — Offers flexible APIs to extend the framework with custom assertions, runners, and reporters. ([source](https://qunitjs.com/))
- [Exception Assertions](https://awesome-repositories.com/f/testing-quality-assurance/exception-assertions.md) — Checks that specific functions throw or reject with expected errors and captures the resulting values. ([source](https://qunitjs.com/blog/))
- [Test Report Exporters](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-reporters/external-result-reporters/tap-result-exporters/test-report-exporters.md) — Exports test results into standardized formats like JUnit XML or LCOV for CI/CD integration. ([source](https://qunitjs.com/plugins/))
- [Global State Leak Detection](https://awesome-repositories.com/f/testing-quality-assurance/global-state-leak-detection.md) — Monitors the window object to identify if a test creates or removes global variables during execution. ([source](https://qunitjs.com/browser/))
- [Headless Test Runners](https://awesome-repositories.com/f/testing-quality-assurance/node-js-test-automation/frontend-unit-testing/headless-test-runners.md) — Enables execution of test suites in a headless browser for background automation. ([source](https://qunitjs.com/plugins/))
- [Exception Assertions](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/assertions-and-validation/assertion-validation-utilities/assertion-libraries/execution-assertions/exception-assertions/exception-assertions.md) — Includes assertions to verify that code throws expected exceptions, validatable via regular expressions or objects. ([source](https://qunitjs.com/upgrade-guide-2.x/))
- [Specialized Matchers](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/assertions-and-validation/assertion-validation-utilities/assertion-libraries/execution-assertions/specialized-matchers.md) — Supports extended assertion logic for numerical tolerances, canvas pixels, and CSS classes. ([source](https://qunitjs.com/plugins/))
- [Browser Automation Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/browser-and-ui-testing/browser-automation-frameworks/browser-automation-testing.md) — Facilitates test execution across local, headless, and cloud browser environments. ([source](https://qunitjs.com/browser/))
- [Cross-Runtime Execution](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/execution-and-infrastructure/test-infrastructure-configuration/cross-browser-testing-tools/cross-runtime-execution.md) — Ensures consistent behavior by running test suites across multiple browsers, worker threads, and server runtimes.
- [Test Execution Filtering](https://awesome-repositories.com/f/testing-quality-assurance/test-execution-filtering.md) — Allows specifying which tests to run using a configuration filter to include or exclude specific cases. ([source](https://qunitjs.com/blog/))
- [Global State Leak Detection](https://awesome-repositories.com/f/testing-quality-assurance/test-process-leak-detection/global-state-leak-detection.md) — Monitors the global window object to identify variables that leak across test cases.
- [Test Suite Filters](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-execution-management/test-suite-filters.md) — Allows users to selectively include or exclude specific test suites based on name patterns.
- [Test Execution Optimizers](https://awesome-repositories.com/f/testing-quality-assurance/testing-infrastructure-management/test-infrastructure/test-execution-optimizers.md) — Prioritizes previously failing tests and filters passing results to accelerate the developer feedback loop. ([source](https://qunitjs.com/browser/))

### Development Tools & Productivity

- [Command-Line Test Runners](https://awesome-repositories.com/f/development-tools-productivity/command-line-test-runners.md) — Provides a terminal-based interface for executing test suites with filtering capabilities. ([source](https://qunitjs.com/cli/))
- [Test Callback Controllers](https://awesome-repositories.com/f/development-tools-productivity/subcommand-registration/callback-execution-controllers/test-callback-controllers.md) — Provides mechanisms to control the execution of asynchronous tests using completion callbacks.

### Programming Languages & Runtimes

- [Test Environment Preloading](https://awesome-repositories.com/f/programming-languages-runtimes/global-scope-script-loading/test-environment-preloading.md) — Allows loading of external scripts and configuration hooks to bootstrap the test environment. ([source](https://qunitjs.com/cli/))

### Software Engineering & Architecture

- [Async Sequence Validation](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-flow-control/async-sequence-validation.md) — Validates the execution order of asynchronous callbacks or event listeners to ensure events occur in the correct sequence. ([source](https://qunitjs.com/intro/))
- [Error Stack Filtering](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters/error-stack-filtering.md) — Filters internal framework call frames from error traces to isolate the actual failure point.
- [Internal Frame Filtering](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters/stack-trace-generation/internal-frame-filtering.md) — Provides cleaned-up stack traces that hide internal framework frames to highlight the exact location of test failures. ([source](https://qunitjs.com/blog/))

### Part of an Awesome List

- [Testing Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/testing-frameworks.md) — Easy-to-use unit testing framework.
