foundation-test-migration

Installation
SKILL.md

Foundation Test Migration

This skill provides guidance on migrating DevTools unit tests to the "foundation" pattern, which is lighter, avoids global singletons, and is compatible with both Node and Browser runtimes (Isomorphic).

Core Concepts

devtools_foundation_module (BUILD.gn)

Use this template for modules that should be platform-agnostic.

  • Enforcement: It type-checks the code against both Browser and Node APIs.
  • Constraint: Avoid direct DOM access (like FileReader or layout metrics) or heavy DevTools dependencies. Use Universe to access services.

TestUniverse

TestUniverse is the preferred way to setup a DevTools-like environment for tests without global singletons.

  • Lazy: Dependencies (targetManager, settings, workspace, etc.) are only created when accessed via getters.
  • Scoped: Does not install instances as globals (avoids Common.Settings.Settings.instance()).
  • Explicit: Uses DevToolsContext to manage dependencies.

Migration Guide

Installs
2
GitHub Stars
4.1K
First Seen
Nov 6, 2026