Skip to content

v0.72.0 - JestLite Documentation & Type Safety Improvements (2026-04-10)

What Changed?

This release improves the JestLite testing framework with better type safety for GAS script boundaries and comprehensive documentation updates. All matcher type checks now use constructor name comparison for robustness across script contexts, and docstrings follow TypeDoc best practices for clarity and beginner-friendliness.


What's New

GAS-Safe Type Checking in JestLite

What it does: Improved toBeInstanceOf() and toThrow() matchers now use constructor name comparison instead of the instanceof operator. This ensures type checks work reliably across Google Apps Script script boundaries, where instanceof can fail due to context switching.

Why this matters: In GAS environments, classes referenced across different script scopes can appear as different constructors, causing instanceof checks to fail unexpectedly. The new approach compares constructor names directly, which is stable across scope boundaries.

Code example:

JavaScript
// Works reliably even across GAS script boundaries
expect(new Date()).toBeInstanceOf(Date);
expect(new CustomClass()).toBeInstanceOf(CustomClass);
expect(() => { throw new TypeError("error"); }).toThrow(TypeError);

Enhanced Documentation

All JestLite docstrings have been rewritten for clarity:

  • Simplified interface descriptions
  • Concise method documentation with clear examples
  • All examples now use javascript (not TypeScript) for GAS compatibility
  • Added @remarks sections for important context and limitations

Added

  • Symbol.toStringTag support for Expect, Matcher, and TestSuite classes for accurate type identification via getTypeOf()
  • @remarks sections in matcher docstrings explaining GAS compatibility considerations

Changed

  • toBeInstanceOf() and toThrow() now use constructor name comparison for GAS script boundary safety
  • Renamed JestLiteLoggerOptions to JestLiteOptions for more accurate naming (reflects both logger and AfterGlow configuration)
  • All JestLite docstrings rewritten for clarity, brevity, and beginner-friendliness
  • Example code blocks changed from TypeScript to JavaScript for GAS compatibility

Fixed

  • toBeInstanceOf() now works reliably across GAS script boundaries
  • toThrow() error type detection is now robust against context switching issues

Is It Safe to Upgrade?

  • Breaking Changes: Yes (renamed JestLiteLoggerOptions to JestLiteOptions)
  • Backward Compatible: Mostly (type checking behavior is now more robust)

For users who explicitly import JestLiteLoggerOptions, you'll need to update imports to use JestLiteOptions instead. Functional behavior is improved: type assertions now work correctly in GAS environments where they previously could fail. No user code changes are needed if you don't explicitly reference the interface type.


Release Details

  • Date: 2026-04-10
  • Version: v0.72.0
  • gaslamp: 133
  • pilotlamp: 91
  • Files Changed: 6 (jestlite module files)
  • Commits:
    • 9fbb3690 - fix(jestlite): use constructor name comparison for instanceof checks (GAS compatibility)
    • fc35e10d - docs(jestlite): improve docstring clarity and consistency
    • 481d2403 - refactor(jestlite): rename JestLiteLoggerOptions to JestLiteOptions
    • 607bc140 - feat(jestlite): add Symbol.toStringTag to classes for better type identification

Known Issues

None at this time.


Next Steps

Future releases will continue improving test framework robustness and expanding documentation coverage. Potential areas include additional matcher types, performance optimizations, and expanded GAS environment compatibility patterns.