Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:SeleniumHQ Selenium Closure Testing MockMatchers

From Leeroopedia
Knowledge Sources
Domains JavaScript_Atoms, Vendored_Library
Last Updated 2026-02-12 00:00 GMT

Overview

Vendored Google Closure Library module providing argument matchers for mock utilities, used by Selenium JavaScript atoms.

Description

goog.testing.mockmatchers is a vendored copy of the Google Closure Library module. It provides matchers for flexible argument matching by type in mock-based tests. Includes built-in matchers such as ArgumentMatcher (base class with custom match functions), IgnoreArgument, InstanceOf, ObjectEquals, RegexpMatch, SaveArgument, and TypeOf. Custom matchers can be created by passing a match function into an ArgumentMatcher instance. Selenium uses this as part of its JavaScript atom infrastructure.

Usage

This module is consumed internally by Selenium's JavaScript atoms build system. Not imported directly by end users.

Code Reference

Source Location

Key Exports

goog.provide('goog.testing.mockmatchers');
goog.provide('goog.testing.mockmatchers.ArgumentMatcher');
goog.provide('goog.testing.mockmatchers.IgnoreArgument');
goog.provide('goog.testing.mockmatchers.InstanceOf');
goog.provide('goog.testing.mockmatchers.ObjectEquals');
goog.provide('goog.testing.mockmatchers.RegexpMatch');
goog.provide('goog.testing.mockmatchers.SaveArgument');
goog.provide('goog.testing.mockmatchers.TypeOf');

// Base matcher
goog.testing.mockmatchers.ArgumentMatcher = function(opt_matchFn, opt_matchName) { ... };
goog.testing.mockmatchers.ArgumentMatcher.prototype.matches = function(toVerify, opt_expectation) { ... };

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment