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 Asserts

From Leeroopedia
Revision as of 11:50, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/SeleniumHQ_Selenium_Closure_Testing_Asserts.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains JavaScript_Atoms, Vendored_Library
Last Updated 2026-02-12 00:00 GMT

Overview

Vendored Google Closure Library module providing JsUnit-style test assertion functions used by Selenium JavaScript atoms.

Description

goog.testing.asserts is a vendored copy of the Google Closure Library module. It provides a comprehensive set of assertion functions for unit testing, including equality checks for primitives, objects, arrays, dates, and regular expressions. It supports deep object comparison with configurable equality predicates, tolerance-based numeric comparison, and detailed error messaging. 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.asserts');

// Equality predicates for well-known types
const EQUALITY_PREDICATES = {
  'String': DOUBLE_EQUALITY_PREDICATE,
  'Number': DOUBLE_EQUALITY_PREDICATE,
  'Boolean': DOUBLE_EQUALITY_PREDICATE,
  'Date': function(date1, date2) { return date1.getTime() == date2.getTime(); },
  'RegExp': TO_STRING_EQUALITY_PREDICATE,
  'Function': TO_STRING_EQUALITY_PREDICATE,
  // ...
};

// Key assertion functions: assertEquals, assertNotEquals,
// assertObjectEquals, assertArrayEquals, assertTrue, assertFalse, etc.

Related Pages

Page Connections

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